]> git.saurik.com Git - wxWidgets.git/commitdiff
using native cocoa method for determining main window, fixes #14287
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 13 Jun 2012 22:53:27 +0000 (22:53 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 13 Jun 2012 22:53:27 +0000 (22:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/frame.cpp

index 2c9e0f39264e072dda82723fa3612448f1754fa4..09cd082182a673d93e50044291a52a7e7d5f9a10 100644 (file)
@@ -225,8 +225,10 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
 {
 #if wxOSX_USE_CARBON
     wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( (WXWindow) FrontNonFloatingWindow() ) , wxFrame );
 {
 #if wxOSX_USE_CARBON
     wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( (WXWindow) FrontNonFloatingWindow() ) , wxFrame );
+#elif wxOSX_USE_COCOA
+    wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( wxOSXGetMainWindow() ) , wxFrame );
 #else
 #else
-    wxFrame* tlf = (wxFrame*) wxTheApp->GetTopWindow();
+    wxFrame* tlf = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame );
 #endif
     bool makeCurrent = false;
 
 #endif
     bool makeCurrent = false;