X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d79e64a00b88fda5e9e2854b4c2925fba72f902..9166fbf48a5d8a5a5f9d6cb033ad11c6c8a2f136:/src/gtk/menu.cpp?ds=sidebyside diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 6a185f3665..898fb2f5f7 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -337,7 +337,11 @@ wxMenu *wxMenuBar::Remove(size_t pos) // warnings from Ubuntu libdbusmenu gtk_container_remove(GTK_CONTAINER(m_menubar), menu->m_owner); // remove submenu to avoid destroying it when item is destroyed +#ifdef __WXGTK3__ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu->m_owner), NULL); +#else + gtk_menu_item_remove_submenu(GTK_MENU_ITEM(menu->m_owner)); +#endif gtk_widget_destroy( menu->m_owner ); g_object_unref(menu->m_owner); @@ -931,20 +935,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) #ifdef __WXGTK3__ gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), NULL); #else - if (!gtk_check_version(2,12,0)) - { - // gtk_menu_item_remove_submenu() is deprecated since 2.12, but - // gtk_menu_item_set_submenu() can now be used with NULL submenu now so - // just do use it. - gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), NULL); - } - else // GTK+ < 2.12 - { - // In 2.10 calling gtk_menu_item_set_submenu() with NULL submenu - // results in critical GTK+ error messages so use the old function - // instead. - gtk_menu_item_remove_submenu(GTK_MENU_ITEM(mitem)); - } + gtk_menu_item_remove_submenu(GTK_MENU_ITEM(mitem)); #endif gtk_widget_destroy(mitem);