]> git.saurik.com Git - wxWidgets.git/commitdiff
adapting to new event version
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Jul 2013 14:52:47 +0000 (14:52 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Jul 2013 14:52:47 +0000 (14:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/app.h
src/common/appbase.cpp
src/osx/carbon/app.cpp

index 351a269a28e2676fbedf427ed345f4ed3ce81451..723841913ce40566788798fbc8002ec125792c59 100644 (file)
@@ -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.
index dba66974cb71f2045cb856836f2c69b26fd6ebe9..da6f2948ef91b50a013fb373c7a3cbd80f4ac2ad 100644 (file)
@@ -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;
 }
index c8e358c18515cfd7d30e3525d9aa25d28b995cbf..d460675d4b9d551f93c2689e865eb3b4c307cada 100644 (file)
@@ -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<wxGUIEventLoop*>(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;