From 35e1c4bf30a9e00b8064a44d4950d9fbf24500e5 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 13 Jun 2012 22:53:27 +0000 Subject: [PATCH] using native cocoa method for determining main window, fixes #14287 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/frame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osx/carbon/frame.cpp b/src/osx/carbon/frame.cpp index 2c9e0f3926..09cd082182 100644 --- a/src/osx/carbon/frame.cpp +++ b/src/osx/carbon/frame.cpp @@ -225,8 +225,10 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) { #if wxOSX_USE_CARBON wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( (WXWindow) FrontNonFloatingWindow() ) , wxFrame ); +#elif wxOSX_USE_COCOA + wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( wxOSXGetMainWindow() ) , wxFrame ); #else - wxFrame* tlf = (wxFrame*) wxTheApp->GetTopWindow(); + wxFrame* tlf = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame ); #endif bool makeCurrent = false; -- 2.45.2