X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03f38c58fdd36b1e951dfed81b245a7337bbc3b4..ec45f8ee19190fce57180381611075d3a5b63435:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 51ecbbf56a..ed3763b079 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -300,17 +300,29 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) void wxTextCtrl::Cut() { +#if (GTK_MINOR_VERSION == 1) + gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) ); +#else gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 ); +#endif } void wxTextCtrl::Copy() { +#if (GTK_MINOR_VERSION == 1) + gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) ); +#else gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 ); +#endif } void wxTextCtrl::Paste() { +#if (GTK_MINOR_VERSION == 1) + gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) ); +#else gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 ); +#endif } void wxTextCtrl::Clear() @@ -452,4 +464,12 @@ void wxTextCtrl::SetFont( const wxFont &font ) gtk_widget_set_style( m_text, style ); } +// as our GTK widget is m_text and not m_widget, we have to override +// SetBackgroundColour() to make it work +void wxTextCtrl::SetBackgroundColour( const wxColour &colour ) +{ + wxCHECK_RET( m_text != NULL, "invalid text ctrl" ); + // NB: the GtkEntry and GtkText classes have text_area at the same offset + SetBackgroundColourHelper( colour, GTK_TEXT(m_text)->text_area ); +}