]> git.saurik.com Git - wxWidgets.git/commitdiff
Initialized control member pointers and checked for null pointer
authorJulian Smart <julian@anthemion.co.uk>
Tue, 14 May 2002 14:05:12 +0000 (14:05 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 14 May 2002 14:05:12 +0000 (14:05 +0000)
to make controls sample run on MacOS X again

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/controls/controls.cpp

index eb20debb2537e5bfd2896d65259522357fff9811..c5be4c74fa62c813d6786fe626206e4139c178d1 100644 (file)
@@ -483,9 +483,35 @@ END_EVENT_TABLE()
 // ============================================================================
 
 MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
-       : wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
-         m_text(NULL), m_notebook(NULL)
+       : wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
 {
+    m_listbox = NULL;
+    m_listboxSorted = NULL;
+#if wxUSE_CHOICE
+    m_choice = NULL;
+    m_choiceSorted = NULL;
+#endif
+    m_combo = NULL;
+    m_radio = NULL;
+    m_gauge = NULL;
+    m_gaugeVert = NULL;
+    m_slider = NULL;
+    m_fontButton = NULL;
+    m_lbSelectNum = NULL;
+    m_lbSelectThis = NULL;
+#if wxUSE_SPINBTN
+    m_spinbutton = NULL;
+    m_btnProgress = NULL;
+#endif // wxUSE_SPINBTN
+#if wxUSE_SPINCTRL
+    m_spinctrl = NULL;
+#endif // wxUSE_SPINCTRL
+    m_spintext = NULL;
+    m_checkbox = NULL;
+    m_text = NULL;
+    m_notebook = NULL;
+    m_label = NULL;
+
     m_text = new wxTextCtrl(this, -1, "This is the log window.\n",
                             wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
     m_text->SetBackgroundColour(wxT("wheat"));
@@ -1218,6 +1244,8 @@ void MyPanel::OnSliderUpdate( wxCommandEvent &WXUNUSED(event) )
 
 void MyPanel::OnSpinCtrl(wxSpinEvent& event)
 {
+    if (!m_spinctrl)
+        return ;
     wxString s;
     s.Printf(_T("Spin ctrl changed: now %d (from event: %d)\n"),
              m_spinctrl->GetValue(), event.GetInt());