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:
@@ -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 we're already attached to the menubar, we must update it
|
||||||
if ( IsAttached() )
|
if ( IsAttached() && GetMenuBar()->IsAttached() )
|
||||||
{
|
{
|
||||||
GetMenuBar()->Refresh();
|
GetMenuBar()->Refresh();
|
||||||
}
|
}
|
||||||
@@ -344,7 +344,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
|||||||
|
|
||||||
::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1);
|
::DeleteMenuItem(MAC_WXHMENU(m_hMenu) , pos + 1);
|
||||||
|
|
||||||
if ( IsAttached() )
|
if ( IsAttached() && GetMenuBar()->IsAttached() )
|
||||||
{
|
{
|
||||||
// otherwise, the change won't be visible
|
// otherwise, the change won't be visible
|
||||||
GetMenuBar()->Refresh();
|
GetMenuBar()->Refresh();
|
||||||
|
Reference in New Issue
Block a user