Re: Which widget id triggered the event?



I don't get it. The widget that triggered an event should be passed in to @_ for your callback. Why can't you just use that?

That said, all of Emmanuele's comments apply.

-Ken

MICHAEL MCGINN wrote:
Hi,
Is there any way to figure out which widget id triggered an event? An example I have a common function that could be triggered by either a button click, menuitem, popup menuitem, etc... Depending on what widget was used I want call the same function, detemine which widget, then process accordingly. Based on which widget I would perform all or a subset of the function. I've looked into the Gtk2::main and Gtk2::Widget methods and they provide the event widget (GtkMenuItem) and complete path (GtkWindow.GtkMenu.GtkMenuItem) but I would need the id of the menu item (ex: "menu name1" or "menu name 2") in order to process accordingly. The way I do it now is to have the signal handler from the widget call the function and pass it what it needs. Thanks in advance,
Michael


------------------------------------------------------------------------

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



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