From 265c34ee780792ad5d6fb72fe8f11d56c911ff81 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Apr 2006 21:35:33 +0000 Subject: [PATCH] emit only 1, not 2, events when changing text of a single line text control git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 8e7593fe01..5a7a67d2ab 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -778,9 +778,14 @@ void wxTextCtrl::SetValue( const wxString &value ) gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) ); } - else + else // single line { - gtk_entry_set_text( GTK_ENTRY(m_text), wxGTK_CONV( value ) ); + // gtk_entry_set_text() emits two "changed" signals because internally + // it calls gtk_editable_delete_text() and gtk_editable_insert_text() + // but we want to have only one event + IgnoreNextTextUpdate(); + + gtk_entry_set_text( GTK_ENTRY(m_text), wxGTK_CONV(value) ); } // GRG, Jun/2000: Changed this after a lot of discussion in -- 2.45.2