gio.simple_action

Module for [SimpleAction] class

Types 3

A [gio.simple_action.SimpleAction] is the obvious simple implementation of the [gio.action.Action] interface. This is the easiest way to create an action for purposes of adding it to a [gio.simple_action_group.SimpleActionGroup].

Methods
GType _gType() @property
SimpleAction self()Returns `this`, for use in `with` statements.
SimpleActionGidBuilder builder()Get builder for [gio.simple_action.SimpleAction] Returns: New builder object
bool enabled() @propertyGet `enabled` property. Returns: If @action is currently enabled.
void enabled(bool propval) @propertySet `enabled` property. Params: propval = If @action is currently enabled.
string name() @propertyGet `name` property. Returns: The name of the action. This is mostly meaningful for identifying the action once it has been added to a #GSimpleActionGroup.
glib.variant_type.VariantType parameterType() @propertyGet `parameterType` property. Returns: The type of the parameter that must be given when activating the action.
glib.variant.Variant state() @propertyGet `state` property. Returns: The state of the action, or null if the action is stateless.
void state(glib.variant.Variant propval) @propertySet `state` property. Params: propval = The state of the action, or null if the action is stateless.
glib.variant_type.VariantType stateType() @propertyGet `stateType` property. Returns: The #GVariantType of the state that the action has, or null if the action is stateless.
gio.simple_action.SimpleAction newStateful(string name, glib.variant_type.VariantType parameterType, glib.variant.Variant state)Creates a new stateful action.
void setEnabled(bool enabled)Sets the action as enabled or not.
void setState(glib.variant.Variant value)Sets the state of the action.
void setStateHint(glib.variant.Variant stateHint = null)Sets the state hint for the action.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == glib.variant.Variant))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.simple_action.SimpleAction))) && Parameters!T.length < 3)Connect to `Activate` signal.
gulong connectChangeState(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == glib.variant.Variant))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.simple_action.SimpleAction))) && Parameters!T.length < 3)Connect to `ChangeState` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(string name, glib.variant_type.VariantType parameterType = null)Creates a new action.
Methods
T enabled(bool propval)Set `enabled` property. Params: propval = If @action is currently enabled.
T name(string propval)Set `name` property. Params: propval = The name of the action. This is mostly meaningful for identifying the action once it has been added to a #GSimpleActionGroup. Returns: Builder instance for fl...
T parameterType(glib.variant_type.VariantType propval)Set `parameterType` property. Params: propval = The type of the parameter that must be given when activating the action. Returns: Builder instance for fluent chaining
T state(glib.variant.Variant propval)Set `state` property. Params: propval = The state of the action, or null if the action is stateless. Returns: Builder instance for fluent chaining

Fluent builder for [gio.simple_action.SimpleAction]