From b0ae60498d2a1cab6cff09d425d235a0847135e8 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 24 Jul 2013 06:14:48 +0000 Subject: [PATCH] wiring OnInit on osx to a later point in event processing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/init.cpp | 5 ++++- src/osx/carbon/app.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/init.cpp b/src/common/init.cpp index ee45254523..4de5ae9af9 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -473,6 +473,9 @@ int wxEntryReal(int& argc, wxChar **argv) wxTRY { +#if defined(__WXOSX__) && wxOSX_USE_COCOA_OR_IPHONE + // everything done in OnRun using native callbacks +#else // app initialization if ( !wxTheApp->CallOnInit() ) { @@ -488,7 +491,7 @@ int wxEntryReal(int& argc, wxChar **argv) } callOnExit; WX_SUPPRESS_UNUSED_WARN(callOnExit); - +#endif // app execution return wxTheApp->OnRun(); } diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index aee21c66f6..41e0503116 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -401,13 +401,15 @@ void wxApp::MacReopenApp() } } +#if wxOSX_USE_COCOA_OR_IPHONE void wxApp::OSXOnWillFinishLaunching() { + wxTheApp->OnInit(); } void wxApp::OSXOnDidFinishLaunching() { - + wxTheApp->OnLaunched(); } void wxApp::OSXOnWillTerminate() @@ -415,6 +417,8 @@ void wxApp::OSXOnWillTerminate() wxCloseEvent event; event.SetCanVeto(false); wxTheApp->OnEndSession(event); + + wxTheApp->OnExit(); } bool wxApp::OSXOnShouldTerminate() @@ -423,6 +427,7 @@ bool wxApp::OSXOnShouldTerminate() wxTheApp->OnQueryEndSession(event); return !event.GetVeto(); } +#endif //---------------------------------------------------------------------- // Macintosh CommandID support - converting between native and wx IDs -- 2.45.2