]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid problems with events that might be sent during creation of controls.
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 18 Jun 2006 11:45:30 +0000 (11:45 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 18 Jun 2006 11:45:30 +0000 (11:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp

index 999b4aa3f77ef2f256e708e39d576944a751d590..d95abbd2bbc277ad6fb2a9c748860e8458f16bef 100644 (file)
@@ -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 )