// 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"),
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));
{
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)