X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/28fcfbfe09c79c06502d2929d5c11ab35996c19f..c17b2e31516424a77fd54b8fc192eac133269ce4:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 1b08ecc0a8..9517877940 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1018,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) ); @@ -1033,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);