From: Julian Smart Date: Sat, 14 Feb 2004 23:19:53 +0000 (+0000) Subject: Now sends an exit command to the app so Quit behaves as it should X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/38106243a0b6c5be96f7714e9f177468a0abc54c Now sends an exit command to the app so Quit behaves as it should git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/app.cpp b/src/mac/app.cpp index 42e2c0aba8..0b4b57cc2f 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -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() ; } diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 42e2c0aba8..0b4b57cc2f 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -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() ; }