fix for Insert() with tear off menus

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-04-24 19:50:48 +00:00
parent 300f993794
commit e54cfe2b28
2 changed files with 12 additions and 0 deletions

View File

@@ -963,6 +963,12 @@ bool wxMenu::DoInsert(size_t pos, wxMenuItem *item)
if ( !GtkAppend(item) )
return FALSE;
if ( m_style & wxMENU_TEAROFF )
{
// change the position as the first item is the tear-off marker
pos++;
}
GtkMenuShell *menu_shell = GTK_MENU_SHELL(m_factory->widget);
gpointer data = g_list_last(menu_shell->children)->data;
menu_shell->children = g_list_remove(menu_shell->children, data);

View File

@@ -963,6 +963,12 @@ bool wxMenu::DoInsert(size_t pos, wxMenuItem *item)
if ( !GtkAppend(item) )
return FALSE;
if ( m_style & wxMENU_TEAROFF )
{
// change the position as the first item is the tear-off marker
pos++;
}
GtkMenuShell *menu_shell = GTK_MENU_SHELL(m_factory->widget);
gpointer data = g_list_last(menu_shell->children)->data;
menu_shell->children = g_list_remove(menu_shell->children, data);