]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure popup menus can display sub-menus.
authorKevin Ollivier <kevino@theolliviers.com>
Wed, 23 Apr 2008 23:33:30 +0000 (23:33 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Wed, 23 Apr 2008 23:33:30 +0000 (23:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/menu.cpp

index bc16a338c522cccae9b7479a329f82b75307273c..9311f4fdb63bfc176cc9055d836128bb5c76a39b 100644 (file)
@@ -223,7 +223,10 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
             wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
             pSubMenu->m_menuParent = this ;
 
-            if (wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
+            // We need the !GetMenuBar() check to make sure we run MacBeforeDisplay()
+            // for popup menus and other menus which may not be part of the main
+            // menu bar. 
+            if (!GetMenuBar() || wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
                 pSubMenu->MacBeforeDisplay( true ) ;
 
             if ( pos == (size_t)-1 )