From 45e6e6f8ab806b337dffeb3b52fec7eba3c845ef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Feb 2007 00:34:18 +0000 Subject: [PATCH] call OnInit() from all samples to allow using standard command line options with all of them (patch 1623971) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/access/accesstest.cpp | 3 +++ samples/animate/anitest.cpp | 3 +++ samples/artprov/arttest.cpp | 3 +++ samples/aui/auidemo.cpp | 3 +++ samples/calendar/calendar.cpp | 3 +++ samples/caret/caret.cpp | 3 +++ samples/checklst/checklst.cpp | 3 +++ samples/collpane/collpane.cpp | 3 +++ samples/combo/combo.cpp | 3 +++ samples/config/conftest.cpp | 3 +++ samples/dataview/dataview.cpp | 3 +++ samples/db/dbtest.cpp | 3 +++ samples/dialogs/dialogs.cpp | 3 +++ samples/dialup/nettest.cpp | 3 +++ samples/display/display.cpp | 3 +++ samples/dnd/dnd.cpp | 3 +++ samples/docview/docview.cpp | 3 +++ samples/dragimag/dragimag.cpp | 3 +++ samples/drawing/drawing.cpp | 3 +++ samples/dynamic/dynamic.cpp | 3 +++ samples/erase/erase.cpp | 3 +++ samples/event/event.cpp | 3 +++ samples/except/except.cpp | 3 +++ samples/exec/exec.cpp | 3 +++ samples/font/font.cpp | 3 +++ samples/help/demo.cpp | 3 +++ samples/html/about/about.cpp | 3 +++ samples/html/help/help.cpp | 3 +++ samples/html/helpview/helpview.cpp | 3 +++ samples/html/htmlctrl/htmlctrl.cpp | 3 +++ samples/html/printing/printing.cpp | 3 +++ samples/html/test/test.cpp | 3 +++ samples/html/virtual/virtual.cpp | 3 +++ samples/html/widget/widget.cpp | 3 +++ samples/html/zip/zip.cpp | 3 +++ samples/image/image.cpp | 3 +++ samples/internat/internat.cpp | 3 +++ samples/ipc/client.cpp | 3 +++ samples/ipc/server.cpp | 3 +++ samples/joytest/joytest.cpp | 3 +++ samples/keyboard/keyboard.cpp | 3 +++ samples/layout/layout.cpp | 3 +++ samples/listbox/lboxtest.cpp | 3 +++ samples/listctrl/listtest.cpp | 3 +++ samples/mdi/mdi.cpp | 3 +++ samples/mediaplayer/mediaplayer.cpp | 3 +++ samples/memcheck/memcheck.cpp | 3 +++ samples/menu/menu.cpp | 3 +++ samples/mfc/mfctest.cpp | 3 +++ samples/minifram/minifram.cpp | 3 +++ samples/mobile/styles/styles.cpp | 3 +++ samples/mobile/wxedit/wxedit.cpp | 3 +++ samples/multimon/multimon_test.cpp | 3 +++ samples/nativdlg/nativdlg.cpp | 3 +++ samples/notebook/notebook.cpp | 3 +++ samples/oleauto/oleauto.cpp | 3 +++ samples/opengl/cube/cube.cpp | 3 +++ samples/opengl/isosurf/isosurf.cpp | 3 +++ samples/opengl/penguin/penguin.cpp | 3 +++ samples/ownerdrw/ownerdrw.cpp | 3 +++ samples/png/pngdemo.cpp | 3 +++ samples/popup/popup.cpp | 3 +++ samples/printing/printing.cpp | 3 +++ samples/propsize/propsize.cpp | 3 +++ samples/regtest/regtest.cpp | 3 +++ samples/render/render.cpp | 3 +++ samples/richtext/richtext.cpp | 3 +++ samples/rotate/rotate.cpp | 3 +++ samples/sashtest/sashtest.cpp | 3 +++ samples/scroll/scroll.cpp | 3 +++ samples/scrollsub/scrollsub.cpp | 3 +++ samples/shaped/shaped.cpp | 3 +++ samples/sockets/client.cpp | 3 +++ samples/sockets/server.cpp | 3 +++ samples/sound/sound.cpp | 3 +++ samples/splash/splash.cpp | 3 +++ samples/splitter/splitter.cpp | 3 +++ samples/statbar/statbar.cpp | 3 +++ samples/taskbar/tbtest.cpp | 3 +++ samples/text/text.cpp | 3 +++ samples/thread/thread.cpp | 3 +++ samples/toolbar/toolbar.cpp | 3 +++ samples/treectrl/treetest.cpp | 3 +++ samples/typetest/typetest.cpp | 3 +++ samples/validate/validate.cpp | 3 +++ samples/vscroll/vstest.cpp | 3 +++ samples/wizard/wizard.cpp | 3 +++ samples/xrc/xrcdemo.cpp | 3 +++ 88 files changed, 264 insertions(+) diff --git a/samples/access/accesstest.cpp b/samples/access/accesstest.cpp index 4daa8672ac..3b0938b983 100644 --- a/samples/access/accesstest.cpp +++ b/samples/access/accesstest.cpp @@ -163,6 +163,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_ACCESSIBILITY // Note: JAWS for Windows will only speak the context-sensitive // help if you use this help provider: diff --git a/samples/animate/anitest.cpp b/samples/animate/anitest.cpp index 73bc017306..7ffc31712b 100644 --- a/samples/animate/anitest.cpp +++ b/samples/animate/anitest.cpp @@ -90,6 +90,9 @@ END_EVENT_TABLE() // Initialise this in OnInit, not statically bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"), diff --git a/samples/artprov/arttest.cpp b/samples/artprov/arttest.cpp index 9a69a2535f..45c5d1f45f 100644 --- a/samples/artprov/arttest.cpp +++ b/samples/artprov/arttest.cpp @@ -96,6 +96,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("wxArtProvider sample"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index cfd0c27efc..7a4c5c1bf8 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -548,6 +548,9 @@ END_EVENT_TABLE() bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxFrame* frame = new MyFrame(NULL, wxID_ANY, wxT("wxAUI Sample Application"), diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 719f4b2f1e..2b83737e07 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -266,6 +266,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("Calendar wxWidgets sample") #ifndef __WXWINCE__ diff --git a/samples/caret/caret.cpp b/samples/caret/caret.cpp index 4f811d4838..a519db7faa 100644 --- a/samples/caret/caret.cpp +++ b/samples/caret/caret.cpp @@ -182,6 +182,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create and show the main application window MyFrame *frame = new MyFrame(_T("Caret wxWidgets sample"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/checklst/checklst.cpp b/samples/checklst/checklst.cpp index a6e13a4467..97ae0b0120 100644 --- a/samples/checklst/checklst.cpp +++ b/samples/checklst/checklst.cpp @@ -151,6 +151,9 @@ IMPLEMENT_APP(CheckListBoxApp) // init our app: create windows bool CheckListBoxApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + CheckListBoxFrame *pFrame = new CheckListBoxFrame ( NULL, diff --git a/samples/collpane/collpane.cpp b/samples/collpane/collpane.cpp index 4d535eef94..165cd9325a 100644 --- a/samples/collpane/collpane.cpp +++ b/samples/collpane/collpane.cpp @@ -126,6 +126,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create and show the main frame MyFrame* frame = new MyFrame; diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index e4cde90f95..2d705f1523 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("wxComboCtrl and wxOwnerDrawnComboBox Sample")); diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index 112e79056d..aea01ea493 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -85,6 +85,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // we're using wxConfig's "create-on-demand" feature: it will create the // config object when it's used for the first time. It has a number of // advantages compared with explicitly creating our wxConfig: diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index be70dd56be..a8e6d7935a 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -365,6 +365,9 @@ IMPLEMENT_APP (MyApp) bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + MyFrame *frame = new MyFrame(NULL, wxT("wxDataViewCtrl feature test"), 10, 10, 800, 340); frame->Show(true); diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index 211f6ca7c3..20fc064e0c 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -635,6 +635,9 @@ void CheckSupportForAllDataTypes(wxDb *pDb) bool DatabaseDemoApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + DbConnectInf = NULL; Contact = NULL; diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 9828815a22..ca35532285 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -238,6 +238,9 @@ MyCanvas *myCanvas = (MyCanvas *) NULL; // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_IMAGE wxInitAllImageHandlers(); #endif diff --git a/samples/dialup/nettest.cpp b/samples/dialup/nettest.cpp index f69bcabd27..0ad2bd4330 100644 --- a/samples/dialup/nettest.cpp +++ b/samples/dialup/nettest.cpp @@ -150,6 +150,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("Dial-up wxWidgets demo"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/display/display.cpp b/samples/display/display.cpp index 7ee089971d..683cb0375e 100644 --- a/samples/display/display.cpp +++ b/samples/display/display.cpp @@ -167,6 +167,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #ifdef __WXMSW__ if ( argc == 2 && !wxStricmp(argv[1], _T("/dx")) ) { diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 10822d957c..beef9c121b 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -883,6 +883,9 @@ END_EVENT_TABLE() // `Main program' equivalent, creating windows and returning main app frame bool DnDApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD // switch on trace messages #if wxUSE_LOG diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index b8d95575ac..3a2f1a5582 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -55,6 +55,9 @@ MyApp::MyApp(void) bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + //// Find out if we're: //// multiple window: multiple windows, each view in a separate frame //// single window: one view (within the main frame) and one document at a time, as in Windows Write. diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index 557f0a1ef9..88881823a3 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -368,6 +368,9 @@ MyApp::MyApp() bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_LIBPNG wxImage::AddHandler( new wxPNGHandler ); #endif diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 99b6b86dc3..95fadd09ba 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -353,6 +353,9 @@ bool MyApp::LoadImages() // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("Drawing sample"), wxPoint(50, 50), wxSize(550, 340)); diff --git a/samples/dynamic/dynamic.cpp b/samples/dynamic/dynamic.cpp index 571e1cfdf8..e6594a8312 100644 --- a/samples/dynamic/dynamic.cpp +++ b/samples/dynamic/dynamic.cpp @@ -66,6 +66,9 @@ IMPLEMENT_APP (MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340); diff --git a/samples/erase/erase.cpp b/samples/erase/erase.cpp index 87070e96fc..94dd570ec4 100644 --- a/samples/erase/erase.cpp +++ b/samples/erase/erase.cpp @@ -117,6 +117,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + MyFrame *frame = new MyFrame; frame->Show(true); diff --git a/samples/event/event.cpp b/samples/event/event.cpp index a0647391ae..2b9c5850fb 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -200,6 +200,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("Event wxWidgets Sample"), wxPoint(50, 50), wxSize(600, 340)); diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 256f483637..f401d6ce18 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -238,6 +238,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(); diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index f0f1a4aa2b..5a85d67bf1 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -386,6 +386,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("Exec wxWidgets sample"), wxDefaultPosition, wxSize(500, 140)); diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 0773236da9..722c813fb3 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -234,6 +234,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(wxT("Font wxWidgets demo"), wxPoint(50, 50), wxSize(600, 400)); diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index 819f815468..7749c96fc8 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -287,6 +287,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create a simple help provider to make SetHelpText() do something. // Note that this must be set before any SetHelpText() calls are made. #if USE_SIMPLE_HELP_PROVIDER diff --git a/samples/html/about/about.cpp b/samples/html/about/about.cpp index 282eb37835..9613d9890f 100644 --- a/samples/html/about/about.cpp +++ b/samples/html/about/about.cpp @@ -85,6 +85,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // we use a PNG image in our HTML page wxImage::AddHandler(new wxPNGHandler); diff --git a/samples/html/help/help.cpp b/samples/html/help/help.cpp index 9338525c47..062949c8cf 100644 --- a/samples/html/help/help.cpp +++ b/samples/html/help/help.cpp @@ -102,6 +102,9 @@ // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxInitAllImageHandlers(); #if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB wxFileSystem::AddHandler(new wxZipFSHandler); diff --git a/samples/html/helpview/helpview.cpp b/samples/html/helpview/helpview.cpp index ba4c62925d..3cb2b9bc4d 100644 --- a/samples/html/helpview/helpview.cpp +++ b/samples/html/helpview/helpview.cpp @@ -53,6 +53,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #ifdef __WXMOTIF__ delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used #endif diff --git a/samples/html/htmlctrl/htmlctrl.cpp b/samples/html/htmlctrl/htmlctrl.cpp index 11d195c143..c003f9cb19 100755 --- a/samples/html/htmlctrl/htmlctrl.cpp +++ b/samples/html/htmlctrl/htmlctrl.cpp @@ -125,6 +125,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("wxWebKit Sample")); diff --git a/samples/html/printing/printing.cpp b/samples/html/printing/printing.cpp index 6ce878f0a5..411d7a03b6 100644 --- a/samples/html/printing/printing.cpp +++ b/samples/html/printing/printing.cpp @@ -128,6 +128,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_LIBPNG wxImage::AddHandler(new wxPNGHandler); #endif diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index ae1dee0c81..59b006e2bb 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_SYSTEM_OPTIONS wxSystemOptions::SetOption(wxT("no-maskblt"), 1); #endif diff --git a/samples/html/virtual/virtual.cpp b/samples/html/virtual/virtual.cpp index 8d5a4e91de..27c1b8a57a 100644 --- a/samples/html/virtual/virtual.cpp +++ b/samples/html/virtual/virtual.cpp @@ -155,6 +155,9 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"), wxDefaultPosition, wxSize(640, 480)); diff --git a/samples/html/widget/widget.cpp b/samples/html/widget/widget.cpp index 14ff729970..2d5f6fca74 100644 --- a/samples/html/widget/widget.cpp +++ b/samples/html/widget/widget.cpp @@ -156,6 +156,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame( _("wxHtmlWindow testing application"), wxDefaultPosition, wxSize(640, 480) ); diff --git a/samples/html/zip/zip.cpp b/samples/html/zip/zip.cpp index 3707e4f6f7..60ec2e3e9f 100644 --- a/samples/html/zip/zip.cpp +++ b/samples/html/zip/zip.cpp @@ -97,6 +97,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_LIBPNG wxImage::AddHandler(new wxPNGHandler); #endif diff --git a/samples/image/image.cpp b/samples/image/image.cpp index ae7d3d1324..99c3ab73eb 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -1168,6 +1168,9 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxInitAllImageHandlers(); wxFrame *frame = new MyFrame(); diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index 7f7b8b9cb2..7a91d37e08 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -166,6 +166,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + long lng = -1; if ( argc == 2 ) diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 09ec3059fa..9141746c4a 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -76,6 +76,9 @@ END_EVENT_TABLE() // main frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window m_frame = new MyFrame(NULL, _T("Client")); m_frame->Show(true); diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 9680d222f8..a4f01ac0a5 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -66,6 +66,9 @@ END_EVENT_TABLE() bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window m_frame = new MyFrame(NULL, _T("Server")); m_frame->Show(true); diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 65ca2e196c..0da7193b51 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -43,6 +43,9 @@ int nButtons = 0; // Initialise this in OnInit, not statically bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxJoystick stick(wxJOYSTICK1); if (!stick.IsOk()) { diff --git a/samples/keyboard/keyboard.cpp b/samples/keyboard/keyboard.cpp index 813b93da6e..b922d4dc3e 100644 --- a/samples/keyboard/keyboard.cpp +++ b/samples/keyboard/keyboard.cpp @@ -240,6 +240,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("Keyboard wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index a8d6151231..606813fc27 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -41,6 +41,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame; diff --git a/samples/listbox/lboxtest.cpp b/samples/listbox/lboxtest.cpp index d5dd01608f..6d5fd65b13 100644 --- a/samples/listbox/lboxtest.cpp +++ b/samples/listbox/lboxtest.cpp @@ -322,6 +322,9 @@ END_EVENT_TABLE() bool LboxTestApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxFrame *frame = new LboxTestFrame(_T("wxListBox sample")); frame->Show(); diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index b4252ebb22..cc6106c9bf 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -153,6 +153,9 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame(wxT("wxListCtrl Test")); diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index dbad766691..18e0400163 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"), diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 7b0e93fc0c..7b94f1ff19 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -409,6 +409,9 @@ IMPLEMENT_APP(wxMediaPlayerApp) // ---------------------------------------------------------------------------- bool wxMediaPlayerApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // SetAppName() lets wxConfig and others know where to write SetAppName(wxT("wxMediaPlayer")); diff --git a/samples/memcheck/memcheck.cpp b/samples/memcheck/memcheck.cpp index 9c7cebb9ba..82cbc1e0c4 100644 --- a/samples/memcheck/memcheck.cpp +++ b/samples/memcheck/memcheck.cpp @@ -56,6 +56,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame((wxFrame *) NULL); diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index be55ff793c..97c563ab96 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -344,6 +344,9 @@ IMPLEMENT_APP(MyApp) // main frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame* frame = new MyFrame; diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index 7a3f3d34e4..d0c92194ab 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -232,6 +232,9 @@ BOOL CTheApp::OnIdle(LONG WXUNUSED(lCount)) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if !START_WITH_MFC_WINDOW // as we're not inside wxWidgets main loop, the default logic doesn't work // in our case and we need to do this explicitly diff --git a/samples/minifram/minifram.cpp b/samples/minifram/minifram.cpp index 9964b07b33..4b01ac159f 100644 --- a/samples/minifram/minifram.cpp +++ b/samples/minifram/minifram.cpp @@ -57,6 +57,9 @@ wxButton *button = (wxButton*) NULL; // main frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window main_frame = new MyMainFrame((wxFrame *) NULL, wxID_ANY, _T("wxFrame sample"), wxPoint(100, 100), wxSize(300, 200)); diff --git a/samples/mobile/styles/styles.cpp b/samples/mobile/styles/styles.cpp index 45dd662332..7038275a9c 100644 --- a/samples/mobile/styles/styles.cpp +++ b/samples/mobile/styles/styles.cpp @@ -86,6 +86,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxInitAllImageHandlers(); SetVendorName(_T("Free world")); diff --git a/samples/mobile/wxedit/wxedit.cpp b/samples/mobile/wxedit/wxedit.cpp index 73a259c9ed..b6043f9e66 100644 --- a/samples/mobile/wxedit/wxedit.cpp +++ b/samples/mobile/wxedit/wxedit.cpp @@ -404,6 +404,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + SetVendorName(_T("Free world")); SetAppName(_T("wxEdit")); diff --git a/samples/multimon/multimon_test.cpp b/samples/multimon/multimon_test.cpp index f279ac7559..2347e7fdb3 100644 --- a/samples/multimon/multimon_test.cpp +++ b/samples/multimon/multimon_test.cpp @@ -22,6 +22,9 @@ IMPLEMENT_APP(TestApp) bool TestApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + bool is_use_display = #if wxUSE_DISPLAY true diff --git a/samples/nativdlg/nativdlg.cpp b/samples/nativdlg/nativdlg.cpp index 16e810f785..dce90cc97d 100644 --- a/samples/nativdlg/nativdlg.cpp +++ b/samples/nativdlg/nativdlg.cpp @@ -32,6 +32,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250)); diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 1fc248501e..83f7cb6dd5 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -34,6 +34,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_HELP wxHelpProvider::Set( new wxSimpleHelpProvider ); #endif diff --git a/samples/oleauto/oleauto.cpp b/samples/oleauto/oleauto.cpp index dd207520d4..b360751bdb 100644 --- a/samples/oleauto/oleauto.cpp +++ b/samples/oleauto/oleauto.cpp @@ -125,6 +125,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("OleAuto wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index 20fb88d2be..f711216626 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -521,6 +521,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window (void) MyFrame::Create(NULL); diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index 781d2a8a16..f602caeeb4 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -246,6 +246,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + Args(argc, argv); // Create the main frame window diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp index 8f06fa3c27..9ad96d9e8f 100644 --- a/samples/opengl/penguin/penguin.cpp +++ b/samples/opengl/penguin/penguin.cpp @@ -40,6 +40,9 @@ // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame(NULL, wxT("wxWidgets Penguin Sample"), wxDefaultPosition, wxDefaultSize); diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index 3446f71c14..de9d8f4cde 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -88,6 +88,9 @@ IMPLEMENT_APP(OwnerDrawnApp) // init our app: create windows bool OwnerDrawnApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + OwnerDrawnFrame *pFrame = new OwnerDrawnFrame(NULL, _T("wxWidgets Ownerdraw Sample"), 50, 50, 450, 340); diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp index 20faa8d94d..0cd3cace27 100644 --- a/samples/png/pngdemo.cpp +++ b/samples/png/pngdemo.cpp @@ -27,6 +27,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + wxImage::AddHandler(new wxPNGHandler); // Create the main frame window diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index a1ae9ed6ca..14075eaae7 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -289,6 +289,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window m_frame = new MyFrame(_T("Popup wxWidgets App")); diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index 9701b90f63..d7cdd08585 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -77,6 +77,9 @@ bool WritePageHeader(wxPrintout *printout, wxDC *dc, const wxChar *text, float m bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + wxInitAllImageHandlers(); m_testFont.Create(10, wxSWISS, wxNORMAL, wxNORMAL); diff --git a/samples/propsize/propsize.cpp b/samples/propsize/propsize.cpp index 32bdba1c53..51610d2712 100644 --- a/samples/propsize/propsize.cpp +++ b/samples/propsize/propsize.cpp @@ -114,6 +114,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(_T("Proportional resize"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index a0c05f3a96..a7dc10aceb 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -318,6 +318,9 @@ IMPLEMENT_APP(RegApp) // `Main program' equivalent, creating windows and returning main app frame bool RegApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main frame window and show it RegFrame *frame = new RegFrame(NULL, _T("wxRegTest"), 50, 50, 600, 350); frame->Show(true); diff --git a/samples/render/render.cpp b/samples/render/render.cpp index 4586ef580e..b8a3ddc525 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -201,6 +201,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window new MyFrame; diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 2f0fb87c69..9ed7c48a04 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -333,6 +333,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_HELP wxHelpProvider::Set(new wxSimpleHelpProvider); #endif diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 3b48a063ab..5927f6e7b2 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -127,6 +127,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + #if wxUSE_LIBPNG wxImage::AddHandler( new wxPNGHandler ); #endif diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index fb3accf647..16dd9ff186 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -40,6 +40,9 @@ int winNumber = 1; // Initialise this in OnInit, not statically bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window frame = new MyFrame(NULL, wxID_ANY, _T("Sash Demo"), wxPoint(0, 0), wxSize(500, 400), diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index 098c34f1ea..c740185ad6 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -672,6 +672,9 @@ void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxFrame *frame = new MyFrame(); frame->Show( true ); diff --git a/samples/scrollsub/scrollsub.cpp b/samples/scrollsub/scrollsub.cpp index f8620259de..e26edd550f 100644 --- a/samples/scrollsub/scrollsub.cpp +++ b/samples/scrollsub/scrollsub.cpp @@ -448,6 +448,9 @@ void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxFrame *frame = new MyFrame(); frame->Show( true ); diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index ea00e88566..cc8ed4a232 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -125,6 +125,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxInitAllImageHandlers(); // Create the main application window diff --git a/samples/sockets/client.cpp b/samples/sockets/client.cpp index eebb8a06d7..1536ecef8a 100644 --- a/samples/sockets/client.cpp +++ b/samples/sockets/client.cpp @@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(); diff --git a/samples/sockets/server.cpp b/samples/sockets/server.cpp index 2702c113c4..0e2be5b7dc 100644 --- a/samples/sockets/server.cpp +++ b/samples/sockets/server.cpp @@ -123,6 +123,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main application window MyFrame *frame = new MyFrame(); diff --git a/samples/sound/sound.cpp b/samples/sound/sound.cpp index a517d1a405..4c4c869c83 100644 --- a/samples/sound/sound.cpp +++ b/samples/sound/sound.cpp @@ -159,6 +159,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("wxWidgets Sound Sample")); diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index 1b72d0be68..644caf2d76 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -123,6 +123,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + wxImage::AddHandler(new wxPNGHandler); // create the main application window diff --git a/samples/splitter/splitter.cpp b/samples/splitter/splitter.cpp index 50a48cdbd0..af93ae1ac8 100644 --- a/samples/splitter/splitter.cpp +++ b/samples/splitter/splitter.cpp @@ -148,6 +148,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create and show the main frame MyFrame* frame = new MyFrame; diff --git a/samples/statbar/statbar.cpp b/samples/statbar/statbar.cpp index 06ad57c3b3..8915cd4c40 100644 --- a/samples/statbar/statbar.cpp +++ b/samples/statbar/statbar.cpp @@ -267,6 +267,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window MyFrame *frame = new MyFrame(_T("wxStatusBar sample"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index a0483cac42..fcda0b64e3 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -37,6 +37,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit(void) { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window dialog = new MyDialog(NULL, wxID_ANY, wxT("wxTaskBarIcon Test Dialog"), wxDefaultPosition, wxSize(365, 290)); diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 8cadc01a1d..ba305825e5 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -425,6 +425,9 @@ enum bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("Text wxWidgets sample"), 50, 50, 700, 550); diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index c93424a99f..d85db154a4 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -363,6 +363,9 @@ MyApp::MyApp() // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // uncomment this to get some debugging messages from the trace code // on the console (or just set WXTRACE env variable to include "thread") //wxLog::AddTraceMask("thread"); diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 513f5bc9ad..fcb326433e 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -269,6 +269,9 @@ IMPLEMENT_APP(MyApp) // main frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY, _T("wxToolBar Sample"), diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 70988cda7c..ab2c64abeb 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame(wxT("wxTreeCtrl Test"), 50, 50, 450, 600); diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index 8a22895fc1..1e5ce86779 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -72,6 +72,9 @@ wxString file_name2 = wxString(_T("test_wx2.dat")); bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Types Demo"), wxPoint(50, 50), wxSize(450, 340)); diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index 1aa0304fef..45da677067 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -74,6 +74,9 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create and display the main frame window. MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("Validator Test"), 50, 50, 300, 250); diff --git a/samples/vscroll/vstest.cpp b/samples/vscroll/vstest.cpp index ff4b716705..432c032a7e 100644 --- a/samples/vscroll/vstest.cpp +++ b/samples/vscroll/vstest.cpp @@ -213,6 +213,9 @@ IMPLEMENT_APP(VScrollApp) // 'Main program' equivalent: the program execution "starts" here bool VScrollApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // create the main application window VScrollFrame *frame = new VScrollFrame; diff --git a/samples/wizard/wizard.cpp b/samples/wizard/wizard.cpp index 22de882986..49ce4a5857 100644 --- a/samples/wizard/wizard.cpp +++ b/samples/wizard/wizard.cpp @@ -353,6 +353,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + MyFrame *frame = new MyFrame(_T("wxWizard Sample")); // and show it (the frames, unlike simple controls, are not shown when diff --git a/samples/xrc/xrcdemo.cpp b/samples/xrc/xrcdemo.cpp index db9ac58d28..6c93d4b75b 100644 --- a/samples/xrc/xrcdemo.cpp +++ b/samples/xrc/xrcdemo.cpp @@ -60,6 +60,9 @@ IMPLEMENT_APP(MyApp) // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // If there is any of a certain format of image in the xrcs, then first // load a handler for that image type. This example uses XPMs, but if // you want PNGs, then add a PNG handler, etc. See wxImage::AddHandler() -- 2.45.2