diff --git a/include/wx/textentry.h b/include/wx/textentry.h index 9ebbdeb5bc..d8482d42f0 100644 --- a/include/wx/textentry.h +++ b/include/wx/textentry.h @@ -125,13 +125,11 @@ protected: { public: EventsSuppressor(wxTextEntryBase *text, bool suppress = true) + : m_text(text), + m_suppress(suppress) { - m_suppress = suppress; if ( m_suppress ) - { - m_text = text; m_text->SuppressTextChangedEvents(); - } } ~EventsSuppressor() @@ -144,6 +142,7 @@ protected: wxTextEntryBase *m_text; bool m_suppress; }; + friend class EventsSuppressor; // return true if the events are currently not suppressed