Re: Which widget id triggered the event?
- From: Kenneth Swanson <kswanson watson wustl edu>
- To: MICHAEL MCGINN <mmcginn rogers com>
- Cc: gtk-perl-list gnome org
- Subject: Re: Which widget id triggered the event?
- Date: Fri, 13 Apr 2007 10:09:55 -0500
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]