Which widget id triggered the event?
- From: MICHAEL MCGINN <mmcginn rogers com>
- To: gtk-perl-list gnome org
- Subject: Which widget id triggered the event?
- Date: Fri, 13 Apr 2007 05:59:52 -0700 (PDT)
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]