diff --git a/widget/src/gtk/nsMenu.cpp b/widget/src/gtk/nsMenu.cpp index d162b2e9d51..e21bae0e346 100644 --- a/widget/src/gtk/nsMenu.cpp +++ b/widget/src/gtk/nsMenu.cpp @@ -127,7 +127,8 @@ NS_METHOD nsMenu::AddItem(const nsString &aText) GtkWidget *widget; widget = gtk_menu_item_new_with_label (labelStr); - gtk_menu_append (GTK_MENU (mMenu), widget); +// gtk_menu_append (GTK_MENU (mMenu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget); delete[] labelStr; @@ -143,7 +144,7 @@ NS_METHOD nsMenu::AddItem(nsIMenuItem * aMenuItem) aMenuItem->GetNativeData(voidData); widget = GTK_WIDGET(voidData); - gtk_menu_append (GTK_MENU (mMenu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget); // XXX add aMenuItem to internal data structor list return NS_OK; @@ -163,13 +164,16 @@ NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu) labelStr = Label.ToNewCString(); - parentmenu = GetNativeParent(); + aMenu->GetNativeData(voidData); + parentmenu = GTK_WIDGET(voidData); item = gtk_menu_item_new_with_label (labelStr); - gtk_menu_append (GTK_MENU (parentmenu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (parentmenu), item); delete[] labelStr; + voidData = NULL; + aMenu->GetNativeData(voidData); newmenu = GTK_WIDGET(voidData); @@ -185,7 +189,7 @@ NS_METHOD nsMenu::AddSeparator() { GtkWidget *widget; widget = gtk_menu_item_new (); - gtk_menu_append (GTK_MENU (mMenu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget); return NS_OK; } diff --git a/widget/src/gtk/nsPopUpMenu.cpp b/widget/src/gtk/nsPopUpMenu.cpp index f501be5b03c..9a2a2b19cd9 100644 --- a/widget/src/gtk/nsPopUpMenu.cpp +++ b/widget/src/gtk/nsPopUpMenu.cpp @@ -92,7 +92,7 @@ NS_METHOD nsPopUpMenu::AddSeparator() { GtkWidget *widget; widget = gtk_menu_item_new (); - gtk_menu_append (GTK_MENU (mMenu), widget); + gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget); #if 0 Widget widget = XtVaCreateManagedWidget("__sep", xmSeparatorGadgetClass, mMenu,