X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937013e0fd914d4c42f9f5ec98da665986b93dfa..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 4a2bf61873..a75a511279 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -39,6 +39,7 @@ #include "wx/docview.h" #include "wx/filename.h" #include "wx/link.h" +#include "wx/thread.h" #include @@ -821,7 +822,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) CFRelease( url ) ; CFStringRef path = CFURLCopyFileSystemPath ( urlParent , kCFURLPOSIXPathStyle ) ; CFRelease( urlParent ) ; - wxString cwd = wxMacCFStringHolder(path).AsString(wxLocale::GetSystemEncoding()); + wxString cwd = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding()); wxSetWorkingDirectory( cwd ) ; } @@ -1471,7 +1472,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers bool handled = false ; - wxTopLevelWindowMac *tlw = focus->MacGetTopLevelWindow() ; + wxNonOwnedWindow *tlw = focus->MacGetTopLevelWindow() ; if (tlw) { @@ -1634,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(kEventParamDirectObject, command ); + SendEventToApplication( event ); +}