This works well when an object implements gio::ActionMap (e.g. gtk::Application) and action handlers receive a reference to an object. But it's problematic to use this function with gio::SimpleActionGroup attached to an arbitrary widget, because it assumes that handlers receive a group and not a widget reference.
Could this function be extended and be generic over handlers' recipients' type?
That is basically the C API. A random widget doesn't necessarily implement GActionMap and it is probably easier to use the install_action helpers in this case
ActionMapExtManual::add_action_entries
is defined likeThis works well when an object implements
gio::ActionMap
(e.g.gtk::Application
) and action handlers receive a reference to an object. But it's problematic to use this function withgio::SimpleActionGroup
attached to an arbitrary widget, because it assumes that handlers receive a group and not a widget reference.Could this function be extended and be generic over handlers' recipients' type?