]> git.saurik.com Git - wxWidgets.git/commitdiff
Add MacHideApp
authorRobin Dunn <robin@alldunn.com>
Fri, 22 Feb 2008 20:37:43 +0000 (20:37 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 22 Feb 2008 20:37:43 +0000 (20:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/carbon/app.h
src/mac/carbon/app.cpp

index e44056bd9bd45d3540c3fd16e3c11c73c848d41c..5a4fc4b923b8f37a958df8e37aa9c7f46de11d3d 100644 (file)
@@ -124,6 +124,9 @@ public:
     // in response of a reopen-application apple event
     virtual void         MacReopenApp() ;
 
+    // Hide the application windows the same as the system hide command would do it.
+    void MacHideApp();
+
     DECLARE_EVENT_TABLE()
 };
 
index 62c6ee4992f7be7332f153c0eb8f2c788a2a874e..749119f1bf548fba663006cacac509377c42169a 100644 (file)
@@ -1635,3 +1635,14 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess
     event.SetTimestamp(when);
     event.SetEventObject(focus);
 }
+
+
+void wxApp::MacHideApp()
+{
+    wxMacCarbonEvent event( kEventClassCommand , kEventCommandProcess );
+    HICommand command;
+    memset( &command, 0 , sizeof(command) );
+    command.commandID = kHICommandHide ;
+    event.SetParameter<HICommand>(kEventParamDirectObject, command );       
+    SendEventToApplication( event );
+}