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
This commit is contained in:
J. Russell Smyth
1999-08-04 21:19:46 +00:00
parent 17b0d794e6
commit 88b0e1c83d

View File

@@ -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);
}
}