+ char buf[2];
+
+ buf[0] = c;
+ buf[1] = 0;
+ AppendText(buf);
+ return *this;
+}
+#endif
+
+GtkWidget* wxTextCtrl::GetConnectWidget()
+{
+ return GTK_WIDGET(m_text);
+}
+
+bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
+{
+ if (m_windowStyle & wxTE_MULTILINE)
+ return (window == GTK_TEXT(m_text)->text_area);
+ else
+ return (window == GTK_ENTRY(m_text)->text_area);
+}
+
+void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
+{
+ wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+
+ // doesn't work
+}
+
+void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
+{
+ wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+
+ // doesn't work
+}
+
+void wxTextCtrl::SetBackgroundColour( const wxColour &colour )
+{
+ wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+
+ wxControl::SetBackgroundColour( colour );
+
+ wxColour sysbg = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
+ if (sysbg.Red() == colour.Red() &&
+ sysbg.Green() == colour.Green() &&
+ sysbg.Blue() == colour.Blue())
+ {
+ return;
+ }
+
+ if (!m_backgroundColour.Ok()) return;
+
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ GdkWindow *window = GTK_TEXT(m_text)->text_area;
+ m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
+ gdk_window_set_background( window, m_backgroundColour.GetColor() );
+ gdk_window_clear( window );
+ }
+}
+
+void wxTextCtrl::ApplyWidgetStyle()
+{
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ // how ?
+ }
+ else
+ {
+ SetWidgetStyle();
+ gtk_widget_set_style( m_text, m_widgetStyle );
+ }
+}
+
+void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event))
+{
+ Cut();
+}
+
+void wxTextCtrl::OnCopy(wxCommandEvent& WXUNUSED(event))
+{
+ Copy();
+}
+
+void wxTextCtrl::OnPaste(wxCommandEvent& WXUNUSED(event))
+{
+ Paste();
+}