Re: several MenuItem and only One callback
- From: Clive Hobson <clivetown-dev01 yahoo com au>
- To: Xavier Larrode <Xavier Larrode irisa fr>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: several MenuItem and only One callback
- Date: Thu, 12 Jun 2008 05:36:31 -0700 (PDT)
Xavier,
I suggest you bind an extra argument (e.g. the plugin's name) when you
connect the signal. For example:
void MyClass::my_unload_plugin(const Glib::ustring & plugin_name) {
// unload the named plugin
}
...
myPluginMenuItems[myPlugin[i].get_name()].signal_activate_item().connect(
sigc::bind<-1>(
sigc::mem_fun(*this, &MyNamespace::MyClass::my_unload_plugin),
myPlugin[i].get_name())
);
...
See the doco for sigc::bind http://libsigc.sourceforge.net/libsigc2/docs/reference/html/group__bind.html#_details
Regards,
Clive
----- Original Message ----
From: Xavier Larrode <Xavier Larrode irisa fr>
To: gtkmm-list <gtkmm-list gnome org>
Sent: Wednesday, 11 June, 2008 6:04:40 PM
Subject: several MenuItem and only One callback
Hi all,
i would like to associate the same callback for several different MenuItem.
For example an unload Plugin SubMenu with several PluginName.
So right now i have connected all MenuItem to the callBack 'unload
Plugin' but i don't know how to get the MenuItem getname information, in
order to delete the selected plugin.
Any idea how i can do that ?
Maybe an other signal may get this information, but i didn"t find any.
Thanks
Send instant messages to your online friends http://au.messenger.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]