Basics
Guides
API Reference
Basics
Guides
API Reference
[323:7] extends: object
Generated low-level callback wrapper for GIR callback activate.
SimpleActionActivateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, parameter, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[465:14] static extends: object
Generated metadata helpers for SimpleAction class surfaces.
properties ()
Returns property metadata for
SimpleAction.
A list.signals ()
Returns signal metadata for
SimpleAction.
A list.[14:7] extends: object
A GSimpleAction is the obvious simple implementation of the
[iface@Gio.Action] interface. This is the easiest way to create an action for
purposes of adding it to a [class@Gio.SimpleActionGroup].
SimpleAction (name = null, parameter_type = null)
Creates a new action. The created action is stateless. See g_simple_action_new_stateful() to create an action that has state.
name is the name of the action.parameter_type is the type of parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameter.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.asAction ()
Wraps this handle as
Action.
A Action object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnActivate (callback Fn, UserData = null)
Indicates that the action was just activated. @parameter will always be of the expected type, i.e. the parameter type specified when the action was created. If an incorrect type is given when activating the action, this signal is not emitted. Since GLib 2.40, if no handler is connected to this signal then the default behaviour for boolean-stated actions with a %NULL parameter type is to toggle them via the #GSimpleAction::change-state signal. For stateful actions where the state type is equal to the parameter type, the default is to forward them directly to #GSimpleAction::change-state. This should allow almost all users of #GSimpleAction to connect only one handler or the other.
Fn is the Aussom callback.Fn is called with (SimpleAction Self, Variant Parameter).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnChangestate (callback Fn, UserData = null)
Indicates that the action just received a request to change its state.
will always be of the correct state type, i.e. the type of the initial state passed to g_simple_action_new_stateful(). If an incorrect type is given when requesting to change the state, this signal is not emitted. If no handler is connected to this signal then the default behaviour is to call g_simple_action_set_state() to set the state to the requested value. If you connect a signal handler then no default action is taken. If the state should change then you must call g_simple_action_set_state() from the handler. An example of a 'change-state' handler: |[ static void change_volume_state (GSimpleAction *action, GVariant *value, gpointer user_data) { gint requested; requested = g_variant_get_int32 (value); // Volume only goes from 0 to 10 if (0 <= requested && requested <= 10) g_simple_action_set_state (action, value); } ]| The handler need not set the state to the requested value. It could set it to any value at all, or take some other action.Fn is the Aussom callback.Fn is called with (SimpleAction Self, Variant Value).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setEnabled (bool Value)
If @action is currently enabled. If the action is disabled then calls to g_action_activate() and g_action_change_state() have no effect.
Value is the new property value.None.setState (object Value)
The state of the action, or %NULL if the action is stateless.
Value is the new property value.None.set_enabled (bool enabled)
Sets the action as enabled or not. An action must be enabled in order to be activated or in order to have its state changed from outside callers. This should only be called by the implementor of the action. Users of the action should not attempt to modify its enabled flag.
enabled is whether the action is enabled.None.set_state (object value)
Sets the state of the action. This directly updates the 'state' property to the given value. This should only be called by the implementor of the action. Users of the action should not attempt to directly modify the 'state' property. Instead, they should call g_action_change_state() to request the change. If the @value GVariant is floating, it is consumed.
value is the new #GVariant for the state.None.set_state_hint (object state_hint)
Sets the state hint for the action. See g_action_get_state_hint() for more information about action state hints.
state_hint is a #GVariant representing the state hint.None.[394:7] extends: object
Generated low-level callback wrapper for GIR callback change-state.
SimpleActionChangestateCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, value, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[298:14] static extends: object
Alternate constructors for SimpleAction. Usage:
SimpleActionCtors.<name>(...). The primary constructor lives
directly on SimpleAction.
newStateful (string name, object parameter_type, object state)
Creates a new stateful action. All future state values must have the same #GVariantType as the initial @state. If the @state #GVariant is floating, it is consumed.
name is the name of the action.parameter_type is the type of the parameter that will be passed to handlers for the #GSimpleAction::activate signal, or %NULL for no parameter.state is the initial state of the action.A new SimpleAction.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.