Re: GTK MenuShell Nested Menu's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

> I'm trying to nest a menu using menu_shell,
> 
> GtkWidget *tray_menu;
> GtkWidget *child_menu;
> tray_menu = gtk_menu_new ();
> child_menu = gtk_menu_new ();
> gtk_menu_shell_append(GTK_MENU_SHELL(tray_menu), child_menu);
> 
> but i get an error:
> Gtk-CRITICAL **: gtk_menu_shell_insert: assertion `GTK_IS_MENU_ITEM
> (child)' failed
> 
> so i guess my question is, how do i set one menu to be another menu's child?

You need to attach submenu to GtkMenuItem. Something like this:

GtkWidget *menu,
          *submenu,
          *item;

menu = gtk_menu_new ();

item = gtk_menu_item_new_with_label ("Submenu");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);

submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu);

Cheers,
Tadej

-- 
Tadej BorovÅak
00386 (0)40 613 131
tadeboro.blogspot.com
tadeboro@xxxxxxxxx
tadej.borovsak@xxxxxxxxx

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux