refresh only for menus which have their menubar attached as well, otherwise an assert...
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 10 May 2005 05:23:27 +0000 (05:23 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 10 May 2005 05:23:27 +0000 (05:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/menu.cpp

index b6e9dd9d3c1a8461c8cebc04fa8ed8048fcb2ded..328ce5605cb346876d65b6e543755893ebe1befd 100644 (file)
@@ -248,7 +248,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
         }
     }
     // if we're already attached to the menubar, we must update it
-    if ( IsAttached() )
+    if ( IsAttached() && GetMenuBar()->IsAttached() )
     {
         GetMenuBar()->Refresh();
     }
@@ -344,7 +344,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
 
     ::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1);
 
-    if ( IsAttached() )
+    if ( IsAttached() && GetMenuBar()->IsAttached() )
     {
         // otherwise, the change won't be visible
         GetMenuBar()->Refresh();