X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/982645201216ab85899291b3bdeb4a803f24bd01..6908078e2759d5036152e763337fe12acb2e9b89:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index f83398df44..9517877940 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -10,6 +10,8 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_TEXTCTRL + #include "wx/textctrl.h" #ifndef WX_PRECOMP @@ -1016,9 +1018,12 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) return; } - void* blockWidget = IsMultiLine() ? (void*)m_buffer : (void*)m_text; - g_signal_handlers_block_by_func(blockWidget, - (gpointer)gtk_text_changed_callback, this); + if ( !(flags & SetValue_SendEvent) ) + { + g_signal_handlers_block_by_func(GetTextObject(), + (gpointer)gtk_text_changed_callback, this); + } + if ( IsMultiLine() ) { gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) ); @@ -1031,12 +1036,16 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) &start, &end); } } - else + else // single line { gtk_entry_set_text( GTK_ENTRY(m_text), buffer ); } - g_signal_handlers_unblock_by_func(blockWidget, - (gpointer)gtk_text_changed_callback, this); + + if ( !(flags & SetValue_SendEvent) ) + { + g_signal_handlers_unblock_by_func(GetTextObject(), + (gpointer)gtk_text_changed_callback, this); + } // This was added after discussion on the list SetInsertionPoint(0); @@ -1989,3 +1998,5 @@ wxTextCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { return GetDefaultAttributesFromGTKWidget(gtk_entry_new, true); } + +#endif // wxUSE_TEXTCTRL