refresh only for menus which have their menubar attached as well, otherwise an assert is triggered
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c1c4cf8924
commit
b6d4a1afde
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user