From 951a1f6009bb9b5f719425eed116a320c58c32d0 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Wed, 23 Apr 2008 23:33:30 +0000 Subject: [PATCH] Ensure popup menus can display sub-menus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/menu.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index bc16a338c5..9311f4fdb6 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -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 ) -- 2.45.2