- if ( m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() || tlw == this )
- makeCurrent = true ;
- // or we have a situation where this is a App Level Menubar like MDI
- else if ( tlw != NULL && tlw->GetMenuBar() == NULL && ((wxFrame*)wxTheApp->GetTopWindow()) == this )
- makeCurrent = true ;
-
- wxFrameBase::AttachMenuBar(menuBar);
+ if ( (tlf == this) || (m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar()) )
+ makeCurrent = true;
+ // or there is an app-level menubar like MDI
+ else if ( tlf && (tlf->GetMenuBar() == NULL) && (((wxFrame*)wxTheApp->GetTopWindow()) == this) )
+ makeCurrent = true;
+
+ wxFrameBase::AttachMenuBar( menuBar );