Re: popup menu



On Thu, 2003-12-04 at 13:21, Thomas Bayen wrote:
Hi,

In my program I want to open a popup menu when the user clicks a button.
It's a bit like an optionmenu but not really the same so I do not want
to use an optionmenu.

(This is not the same problem I had some time ago with my self-made
popup window, asking for help on this list. This time I try to use just
the "standard" popup menu.)

There is an example in C in the docs on page
http://developer.gnome.org/doc/API/2.0/gtk/GtkMenu.html but I can't make
it work with perl. I have no event (because the "clicked" signal of
Gtk2::Button does not give me one). But the function
gtk_get_current_event_time() mentioned in
http://developer.gnome.org/doc/API/2.0/gtk/GtkMenu.html#gtk-menu-popup
seems not to exist. :-(

take a look here the current_event_xxx functions are bound:
http://www.neces.com/gtk2-perl/gtk2-perl-doc/Gtk2/main.html#event_or_undef_Gtk2_
so you should be able to use it in your situation.

the other option would be to connect a signal handler to event for the
widget with an event mask letting through only the ones you want. that
signal provides the event as a parameter. i thought there was an example
of this somewhere but i can't seem to find it at the moment. 

-rm




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