Re: GtkMenu
| From: | Steph | Date: | Thu, 27 Dec 2001 23:26:39 +0000 |
| Subject: | Re: GtkMenu | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-933@lists.php.net to get a copy of this message | ||
Yep, the menu's just a container.
You need to do something like
$menubar = &new GtkMenuBar();
$rules_window->add($menubar);
/* Only add $menubar, not $menu_1 itself, which is only the first dropdown list.
NB $menubar would probably be a lot more useful pack_started into a GtkVBox than added to a
GtkWindow anyways ;) */
$menu1_label = &new GtkMenuItem("Header");
$menubar->append($menu1_label);
$menu1_label->set_submenu($menu1);
----- Original Message -----
From: "Anson Rinesmith" <anson@lddcorp.com>
To: "PHP GTK GENERAL" <php-gtk-general@lists.php.net>
Sent: Thursday, December 27, 2001 11:04 PM
Subject: [PHP-GTK] GtkMenu
I've looked through the docs, and the archive, and It seems Menu's have been a stumper to
most people.
I am just trying to create a basic selectable Menu
$rules_window = &new GtkWindow();
$menu1 =& new GtkMenu();
$item1 =& new GtkMenuItem('Item1');
$menu1->append($item1);
$item2 =& new GtkMenuItem('Item2');
$menu1->append($item2);
$rules_window->add($menu1);
Getting
Gtk-CRITICAL **: file gtkcontainer.c: line 715 (gtk_container_add): assertion
'widget->parent == NULL' failed