From: J. Russell Smyth Date: Wed, 4 Aug 1999 21:19:46 +0000 (+0000) Subject: Moved initialization of status bar to eliminate assert caused by new X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/88b0e1c83deb0e24330c0cabdb258028bd2d88dc Moved initialization of status bar to eliminate assert caused by new controls trying to set s-bar text git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index 741ddec001..a7f130b1f3 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -175,6 +175,12 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int // create the menu InitMenu(); + // create the status line + const int widths[] = { -1, 60 }; + CreateStatusBar(2); + SetStatusWidths(2, widths); + SetStatusText("no selection", 0); + // make a panel with some controls wxPanel *pPanel = new wxPanel(this, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL); @@ -243,12 +249,6 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int delete[] astrChoices; - // create the status line - const int widths[] = { -1, 60 }; - CreateStatusBar(2); - SetStatusWidths(2, widths); - SetStatusText("no selection", 0); - Show(TRUE); } @@ -293,4 +293,4 @@ void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event) strSelection.sprintf("item %d was %schecked", nItem, m_pListBox->IsChecked(nItem) ? "" : "un"); SetStatusText(strSelection); -} \ No newline at end of file +}