зеркало из https://github.com/mozilla/gecko-dev.git
fix menu code... submenus are not added correctly for some reason, but the
earlier warnings are gone.
This commit is contained in:
Родитель
e9e397da2d
Коммит
461243c902
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче