X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea7fb468ce817eaf67f2a013fef216b846c09fb0..f1d5aa4eca541a2f90044a63f555985d6bd4adf3:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index dbad766691..b06f1bf257 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -112,6 +112,9 @@ END_EVENT_TABLE() // Initialise this in OnInit, not statically bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("MDI Demo"), @@ -264,11 +267,6 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) ) subframe->SetMenuBar(menu_bar); #endif // wxUSE_MENUS -#if wxUSE_STATUSBAR - subframe->CreateStatusBar(); - subframe->SetStatusText(title); -#endif // wxUSE_STATUSBAR - int width, height; subframe->GetClientSize(&width, &height); MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); @@ -518,8 +516,13 @@ void MyChild::OnPaste(wxCommandEvent& WXUNUSED(event)) { wxClipboardLocker lock; wxTextDataObject data; - canvas->SetText(wxTheClipboard->GetData(data) ? data.GetText().c_str() - : _T("No text on clipboard")); + canvas->SetText( + ( + wxTheClipboard->GetData(data) ? + data.GetText() : + wxString("No text on clipboard") + ).c_str() + ); } void MyChild::OnUpdatePaste(wxUpdateUIEvent& event)