X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22800f325f129a140280a74ea50b0525acea91bb..82a16d7e5e5c83e95a4caa7314de2dbfbd1debdc:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 94718d2f35..023debbdb1 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -518,7 +518,8 @@ wxString wxTextCtrl::GetValue() const #else wxCharBuffer buffer( wxConvLocal.cWC2WX( wxConvUTF8.cMB2WC( text ) ) ); #endif - tmp = buffer; + if ( buffer ) + tmp = buffer; g_free( text ); #else @@ -550,6 +551,9 @@ void wxTextCtrl::SetValue( const wxString &value ) wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( value ) ) ); #endif GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) ); + if (gtk_text_buffer_get_char_count(text_buffer) != 0) + IgnoreNextTextUpdate(); + gtk_text_buffer_set_text( text_buffer, buffer, strlen(buffer) ); #else @@ -1482,8 +1486,10 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) if ( !wxControl::SetBackgroundColour( colour ) ) return FALSE; +#ifndef __WXGTK20__ if (!m_widget->window) return FALSE; +#endif if (!m_backgroundColour.Ok()) return FALSE;