Re: GtkMenu Problem
| From: | Steph | Date: | Thu, 22 Nov 2001 17:53:08 +0000 |
| Subject: | Re: GtkMenu Problem | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-677@lists.php.net to get a copy of this message | ||
OK, I have it now. I was half-right and half-wrong - you get the items in the dropdown list from a
GtkMenuBar item by appending GtkMenuItems to a GtkMenu and then setting the GtkMenu as a submenu for
a GtkMenuItem in a GtkMenuBar. (Got that?!)
Why not just use GtkItemFactory? :) It's a lot better documented.
See attached code, and ignore the bit with the functions & signals, that's a separate
issue...
Cheers -
----- Original Message -----
From: "Bogomil Shopov" <contact_bogomil@bitex.bg>
To: <php-gtk-general@lists.php.net>
Sent: Thursday, November 22, 2001 1:48 PM
Subject: [PHP-GTK] GtkMenu Problem
> Hello !
> Where is my mistake?
>
> .........
>
> $mbar=&new GtkMenuBar();
> $menu = &new GtkMenu();
> $menu->set_title("Main");
> $mbar->insert($menu,1);
> $mitem= &new GtkMenuItem("Connect");
> $menu->insert($mitem,1);
>
> $window->add($mbar);
> $window->show_all();
>
> Errors:
>
> Gtk-CRITICAL **: file gtkmenushell.c: line 309 (gtk_menu_shell_insert):
> assertion `GTK_IS_MENU_ITEM
> (child)' failed
>
> Gtk-CRITICAL **: file gtkbin.c: line 217 (gtk_bin_add): assertion
> `bin->child == NULL' failed
>
>
> Thank you!
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-gtk-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>