From 7c2151fa69d31ea9641dd9b3daaa2d810b913cfe Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 18 Jun 2006 11:45:30 +0000 Subject: [PATCH] Avoid problems with events that might be sent during creation of controls. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 999b4aa3f7..d95abbd2bb 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -1377,15 +1377,17 @@ void MyPanel::OnCombo( wxCommandEvent &event ) void MyPanel::OnComboTextChanged(wxCommandEvent& event) { - wxLogMessage(wxT("EVT_TEXT for the combobox: \"%s\" (event) or \"%s\" (control)."), - event.GetString().c_str(), - m_combo->GetValue().c_str()); + if (m_combo) + wxLogMessage(wxT("EVT_TEXT for the combobox: \"%s\" (event) or \"%s\" (control)."), + event.GetString().c_str(), + m_combo->GetValue().c_str()); } void MyPanel::OnComboTextEnter(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."), - m_combo->GetValue().c_str()); + if (m_combo) + wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."), + m_combo->GetValue().c_str()); } void MyPanel::OnComboButtons( wxCommandEvent &event )