GSimpleAction
GSimpleAction is a convenience class in GLib's action framework that provides a straightforward, single-parameter action implementation. It implements the GAction and GActionGroup interfaces and is designed to simplify adding actions to applications that use the GNOME/Gtk action model. A GSimpleAction has a name and an optional parameter type (a GVariantType) describing what parameter it accepts when activated. It can be created as parameterless or stateful via g_simple_action_new and g_simple_action_new_stateful. When activated, the action dispatches to a user-supplied handler, typically connected to the action's activate signal, and receives the parameter as a GVariant matching the declared type. The action’s enabled state and, for stateful actions, its current state can be read and modified.
GSimpleAction is often used together with GSimpleActionGroup, which collects multiple actions under a single group that
The class is well-suited for simple actions that do not require a custom GAction implementation. For more
See also: GAction, GActionGroup, GSimpleActionGroup, GLib/GIO action framework.