]> git.saurik.com Git - wxWidgets.git/commitdiff
Now sends an exit command to the app so Quit behaves as it should
authorJulian Smart <julian@anthemion.co.uk>
Sat, 14 Feb 2004 23:19:53 +0000 (23:19 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 14 Feb 2004 23:19:53 +0000 (23:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/app.cpp
src/mac/carbon/app.cpp

index 42e2c0aba8a650105bbe87cbc893b1e841c57695..0b4b57cc2ff36bb79c4031d5c5b06f97eaf99d81 100644 (file)
@@ -231,12 +231,14 @@ short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU
 
 short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply))
 {
-       wxWindow* win = GetTopWindow() ;
+    wxWindow* win = GetTopWindow() ;
     if ( win )
     {
-        win->Close(TRUE ) ;
+        wxCommandEvent exitEvent(wxEVT_COMMAND_MENU_SELECTED, s_macExitMenuItemId);
+        if (!win->ProcessEvent(exitEvent))
+            win->Close(TRUE ) ;
     }
-       else
+    else
     {
         ExitMainLoop() ;
     }
index 42e2c0aba8a650105bbe87cbc893b1e841c57695..0b4b57cc2ff36bb79c4031d5c5b06f97eaf99d81 100644 (file)
@@ -231,12 +231,14 @@ short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNU
 
 short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply))
 {
-       wxWindow* win = GetTopWindow() ;
+    wxWindow* win = GetTopWindow() ;
     if ( win )
     {
-        win->Close(TRUE ) ;
+        wxCommandEvent exitEvent(wxEVT_COMMAND_MENU_SELECTED, s_macExitMenuItemId);
+        if (!win->ProcessEvent(exitEvent))
+            win->Close(TRUE ) ;
     }
-       else
+    else
     {
         ExitMainLoop() ;
     }