зеркало из https://github.com/mozilla/pjs.git
fix menu code... submenus are not added correctly for some reason, but the
earlier warnings are gone.
This commit is contained in:
Родитель
ab983fcc59
Коммит
97dd738601
|
@ -127,7 +127,8 @@ NS_METHOD nsMenu::AddItem(const nsString &aText)
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
widget = gtk_menu_item_new_with_label (labelStr);
|
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;
|
delete[] labelStr;
|
||||||
|
|
||||||
|
@ -143,7 +144,7 @@ NS_METHOD nsMenu::AddItem(nsIMenuItem * aMenuItem)
|
||||||
aMenuItem->GetNativeData(voidData);
|
aMenuItem->GetNativeData(voidData);
|
||||||
widget = GTK_WIDGET(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
|
// XXX add aMenuItem to internal data structor list
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -163,13 +164,16 @@ NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu)
|
||||||
|
|
||||||
labelStr = Label.ToNewCString();
|
labelStr = Label.ToNewCString();
|
||||||
|
|
||||||
parentmenu = GetNativeParent();
|
aMenu->GetNativeData(voidData);
|
||||||
|
parentmenu = GTK_WIDGET(voidData);
|
||||||
|
|
||||||
item = gtk_menu_item_new_with_label (labelStr);
|
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;
|
delete[] labelStr;
|
||||||
|
|
||||||
|
voidData = NULL;
|
||||||
|
|
||||||
aMenu->GetNativeData(voidData);
|
aMenu->GetNativeData(voidData);
|
||||||
newmenu = GTK_WIDGET(voidData);
|
newmenu = GTK_WIDGET(voidData);
|
||||||
|
|
||||||
|
@ -185,7 +189,7 @@ NS_METHOD nsMenu::AddSeparator()
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
widget = gtk_menu_item_new ();
|
widget = gtk_menu_item_new ();
|
||||||
gtk_menu_append (GTK_MENU (mMenu), widget);
|
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ NS_METHOD nsPopUpMenu::AddSeparator()
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
widget = gtk_menu_item_new ();
|
widget = gtk_menu_item_new ();
|
||||||
gtk_menu_append (GTK_MENU (mMenu), widget);
|
gtk_menu_shell_append (GTK_MENU_SHELL (mMenu), widget);
|
||||||
#if 0
|
#if 0
|
||||||
Widget widget = XtVaCreateManagedWidget("__sep", xmSeparatorGadgetClass,
|
Widget widget = XtVaCreateManagedWidget("__sep", xmSeparatorGadgetClass,
|
||||||
mMenu,
|
mMenu,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче