I have built a GTK GUI using Glade, which mean I have a *.glade file that I can use with my application. I have been able to get widgets to interact with them, but I am clueless as to how I can connect a signal handler to a Menu entry.
The signal I want to connect is the one that is emitted when you click on the menu entry. Like you would do in you web browser, you go to File, then click on one entry.
What is the name of that event, and what is the gtkmm function to call ? I am confused as to what element I should be trying to interact with, is it the GtkMenu, GtkMenuShell... ? Even better, can I do it from Glade's interface ?
At first I thought the event was activate-current
so I tried to use the method which would logically connect to it, like you would do for a clicked
event on a button.
Here's the code that is not working, because the method doesn't exist:
Gtk::MenuShell* help_menu;
p_builder->get_widget("helpMenu", help_menu);
help_menu->signal_activate_current().connect(sigc::ptr_fun(&on_help_menu_activate_current));
src/GUI.cpp:11:16: error: ‘class Gtk::MenuShell’ has no member named ‘signal_activate_current’ help_menu->signal_activate_current().connect(sigc::ptr_fun(&on_help_menu_activate_current));