Re: GtkMenuItems and popup menus
| From: | Rich Payne | Date: | Thu, 12 Jul 2001 17:55:44 +0000 |
| Subject: | Re: GtkMenuItems and popup menus | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2145@lists.php.net to get a copy of this message | ||
Of course... php-4.0.7-dev and php-gtk CVS from June 25 it looks like.
Here's code snippet:
function construct_popup_menu() {
$m = &new GtkMenu();
$mi_move = &new GtkMenuItem( 'Move');
$m->add($mi_move);
$mi_copy = &new GtkMenuItem( 'Copy');
$m->add($mi_copy);
$mi_delete = &new GtkMenuItem( 'Delete');
$m->add($mi_delete);
$mi_sep = &new GtkMenuItem('');
$m->add($mi_sep);
$mi_reply = &new GtkMenuItem ('Reply');
$m->add($mi_reply);
$mi_reply_to_all = &new GtkMenuItem ('Reply To All');
$m->add($mi_reply_to_all);
$mi_forward = &new GtkMenuItem ('Forward');
$m->add($mi_forward);
$m->show_all();
return $m;
}
this will generate an empty menu item for the separator, I've also tried
an append instead of an add, that didn't seem to make a difference.
hope that helps,
--rdp
On Thu, 12 Jul 2001, Andrei Zmievski wrote:
> Can you provide a bit more of a code in context for me to work with?
> And which version of PHP-GTK you are using and all that.
>
> On Thu, 12 Jul 2001, Rich Payne wrote:
> >
> > I'm trying to create a popup menu with a separator in the middle, now I
> > came accross this in the GTK+ docs:
> >
> > "The GtkHSeparator widget is not used as a separator within menus. To
> > create a separator in a menu create an empty GtkMenuItem widget using
> > gtk_menu_item_new() and add it to the menu with gtk_menu_append()"
> >
> > OK, so I do that and end up not with a serparator, but just a blank
> > menuitem in the middle of the popup menu.
> >
> > Actually if I code it as
> > $misep = &new GtkMenuItem('');
> > then I get an empty menu item, if I use:
> > $misep = &new GtkMenuItem();
> >
> > (as above) I get a core dump on startup. It looks like it always calls
> > gtk_menu_item_new_with_label (looking at the backtrace).
> >
> > Is this something incorrect in the GTK docs....or just a bug?
> >
> > thanks,
> > --rdp
> >
> > --
> > Rich Payne
> > rpayne@alphalinux.org www.alphalinux.org
> >
> >
> > --
> > PHP GTK Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-gtk-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
>
> -Andrei
>
> Commitment, n.:
> Commitment can be illustrated by a breakfast of ham and eggs. The chicken
> was involved, the pig was committed.
>
>
--
Rich Payne
rpayne@alphalinux.org www.alphalinux.org