From: Stefan Csomor Date: Sun, 28 Jul 2013 14:52:47 +0000 (+0000) Subject: adapting to new event version X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f7105c8fe2710892604ad7e4666c978427d62a89?hp=17243986ece245112e96e260d800f9090746d833 adapting to new event version git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index 351a269a28..723841913c 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -150,6 +150,12 @@ public: virtual bool OSXOnShouldTerminate(); // before application terminates virtual void OSXOnWillTerminate(); + +private: + bool m_onInitResult; + +public: + #endif // Hide the application windows the same as the system hide command would do it. diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index dba66974cb..da6f2948ef 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -324,12 +324,8 @@ int wxAppConsoleBase::MainLoop() { wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop()); -#if defined(__WXOSX__) && wxOSX_USE_COCOA_OR_IPHONE - // OnLaunched called from native app controller -#else if (wxTheApp) wxTheApp->OnLaunched(); -#endif return m_mainLoop ? m_mainLoop->Run() : -1; } diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index c8e358c185..d460675d4b 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -403,13 +403,11 @@ void wxApp::MacReopenApp() #if wxOSX_USE_COCOA_OR_IPHONE void wxApp::OSXOnWillFinishLaunching() { - wxTheApp->OnInit(); + m_onInitResult = OnInit(); } void wxApp::OSXOnDidFinishLaunching() { - wxTheApp->OnLaunched(); - wxEventLoopBase::SetActive(GetMainLoop()); } void wxApp::OSXOnWillTerminate() @@ -417,13 +415,6 @@ void wxApp::OSXOnWillTerminate() wxCloseEvent event; event.SetCanVeto(false); wxTheApp->OnEndSession(event); - - wxGUIEventLoop* mainloop = dynamic_cast(GetMainLoop()); - if ( mainloop ) - mainloop->OSXOnWillTerminate(); - wxEventLoopBase::SetActive(NULL); - - wxTheApp->OnExit(); } bool wxApp::OSXOnShouldTerminate() @@ -896,7 +887,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) return true; } -#if wxOSX_USE_COCOA_OR_CARBON +#if wxOSX_USE_CARBON bool wxApp::CallOnInit() { wxMacAutoreleasePool autoreleasepool;