]> git.saurik.com Git - wxWidgets.git/commitdiff
fix removing menu item, ticket 3387
authorPaul Cornett <paulcor@bullseye.com>
Mon, 26 May 2008 17:28:41 +0000 (17:28 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Mon, 26 May 2008 17:28:41 +0000 (17:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/menu.cpp

index 55f2ac2921e5341df009bac67dbd5a8d63ea343c..2dc83b61608ba2a8a8a60ded261f9d7634a083be 100644 (file)
@@ -829,7 +829,7 @@ wxString wxMenuItem::GTKProcessMenuItemLabel(const wxString& str, wxString *hotK
         hotKey->Empty();
         if(*pc == wxT('\t'))
         {
-            pc++;
+            ++pc;
             hotKey->assign(pc, str.end());
         }
     }
@@ -1215,9 +1215,8 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
         m_prevRadio = NULL;
     }
 
-    // TODO: this code doesn't delete the item factory item and this seems
-    //       impossible as of GTK 1.2.6.
-    gtk_widget_destroy( mitem );
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), NULL);
+    gtk_container_remove(GTK_CONTAINER(m_menu), mitem);
 
     return item;
 }