Gio.SimpleAction.new_stateful

function new_stateful(name: String, parameter_type: GLib.VariantType, state: GLib.Variant): Gio.SimpleAction {
    // Gjs wrapper for g_simple_action_new_stateful()
}
  

Creates a new stateful action.

state is the initial state of the action. All future state values must have the same GLib.VariantType as the initial state.

If the state GVariant is floating, it is consumed.

Since 2.28

name

the name of the action

parameter_type

the type of the parameter to the activate function

state

the initial state of the action

Returns

a new Gio.SimpleAction