From 78f212178ee243e4f6f1c1bd01e26765d20f613f Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 13 Jun 2012 22:32:07 +0000 Subject: [PATCH] exposing mainWindow for C++ git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/cocoa/private.h | 1 + src/osx/carbon/utilscocoa.mm | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 36fcb7f135..283e8ee64b 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -42,6 +42,7 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage( WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image ); CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage ); wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size); +WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow(); class WXDLLIMPEXP_FWD_CORE wxDialog; diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index c0b0dbb8e2..a4c9ba8016 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -343,6 +343,19 @@ WX_UIFont wxFont::OSXCreateUIFont(const wxNativeFontInfo* info) return uiFont; } +#endif + +// ---------------------------------------------------------------------------- +// NSWindow Utils +// ---------------------------------------------------------------------------- + +#if wxOSX_USE_COCOA + +WXWindow wxOSXGetMainWindow() +{ + return [NSApp mainWindow]; +} + #endif // ---------------------------------------------------------------------------- // NSImage Utils -- 2.45.2