diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 56f5848901..c3d56aaee2 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1046,7 +1046,12 @@ void wxTextCtrl::WriteText( const wxString &text ) wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); if ( text.empty() ) + { + // We don't need to actually do anything, but we still need to generate + // an event expected from this call. + SendTextUpdatedEvent(this); return; + } // we're changing the text programmatically DontMarkDirtyOnNextChange(); diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index b5c4fddfe9..96b121de84 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -57,6 +57,10 @@ void TextEntryTestCase::TextChangeEvents() CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); updated.Clear(); + entry->SetValue(""); + CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); + updated.Clear(); + entry->ChangeValue("bar"); CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() );