Skip to content

wip: Widget class actions

Matthias Clasen requested to merge widget-class-actions into master

Allow registering actions per-class

Add a facility to register and install actions. To register them, call gtk_widget_class_install_action in class_init. To install them, call gtk_widget_add_class_actions in init. The handling of these actions is done in GtkActionMuxer, to avoid creating too many objects.

All context menus in GTK have been ported to this way of defining actions.

There is also api to bind shortcuts to actions in class-init, which is meant to replace GtkBindings. The current implementation reuses GtkApplicationAccels, but should be retargeted when the shortcuts branch lands.

The popup-menu keybinding has been converted to this to show how this will work.

Edited by Matthias Clasen

Merge request reports