Menus and Toolbars
There are specific APIs for menus and toolbars, but you should usually deal with them together, creating Gio::SimpleActions that you can refer to in both menus and toolbars. In this way you can handle activation of the action instead of responding to the menu and toolbar items separately. And you can enable or disable both the menu and toolbar item via the action. Gtk::Builder can create menus and toolbars.
This involves the use of the Gio::SimpleActionGroup, Gio::SimpleAction and Gtk::Builder classes, all of which should be instantiated via their create() methods, which return RefPtrs.
Alternatively, Gtk::ActionGroup, Gtk::Action and Gtk::UIManager can be used, but this is not recommended in new code. GtkAction, GtkActionGroup and GtkUIManager are deprecated in GTK+ from version 3.10. The corresponding classes in gtkmm will be deprecated in the future.
- 12.1. Actions
- 12.2. Menubar and Toolbar
- 12.3. Popup Menus
- 12.4. Gio::Resource and glib-compile-resources
- 12.5. Examples