X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3340066af696862df9394469b341b700fe4e3a68..bf60426831535738b1b784629f08e9dd00bf9ecc:/src/mac/frame.cpp diff --git a/src/mac/frame.cpp b/src/mac/frame.cpp index 4d83421744..7f1860a837 100644 --- a/src/mac/frame.cpp +++ b/src/mac/frame.cpp @@ -231,9 +231,35 @@ void wxFrame::OnActivate(wxActivateEvent& event) { m_frameMenuBar->MacInstallMenuBar() ; } + else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame))) + { + // Trying toplevel frame menbar + if( ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar() ) + ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar(); + } } } +void wxFrame::DetachMenuBar() +{ + if ( m_frameMenuBar ) + { + m_frameMenuBar->UnsetInvokingWindow(); + } + + wxFrameBase::DetachMenuBar(); +} + +void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) +{ + wxFrameBase::AttachMenuBar(menuBar); + + if (m_frameMenuBar) + { + m_frameMenuBar->SetInvokingWindow( this ); + } +} + void wxFrame::DoGetClientSize(int *x, int *y) const { wxWindow::DoGetClientSize( x , y ) ;