From: Julian Smart Date: Tue, 14 May 2002 14:05:12 +0000 (+0000) Subject: Initialized control member pointers and checked for null pointer X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/946fb2b9dd3be2f4805ddb2aca67e11f6f7c4cdd?ds=inline Initialized control member pointers and checked for null pointer 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 --- diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index eb20debb25..c5be4c74fa 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -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());