![]() |
![]() |
![]() |
GIO Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
GSimpleAction; GSimpleActionClass; GSimpleAction * g_simple_action_new (const gchar *name, const GVariantType *parameter_type); GSimpleAction * g_simple_action_new_stateful (const gchar *name, const GVariantType *parameter_type, GVariant *state); void g_simple_action_set_enabled (GSimpleAction *simple, gboolean enabled);
A GSimpleAction is the obvious simple implementation of the GSimpleAction interface. This is the easiest way to create an action for purposes of adding it to a GSimpleActionGroup.
See also GtkAction.
typedef struct { } GSimpleAction;
The GSimpleAction structure contains private data and should only be accessed using the provided API
Since 2.28
typedef struct { GObjectClass parent_class; /* signals */ void (* activate) (GSimpleAction *simple, GVariant *parameter); } GSimpleActionClass;
GObjectClass |
|
|
the class closure for the activate signal |
Since 2.28
GSimpleAction * g_simple_action_new (const gchar *name, const GVariantType *parameter_type);
Creates a new action.
The created action is stateless. See g_simple_action_new_stateful()
.
|
the name of the action |
|
the type of parameter to the activate function. allow-none. |
Returns : |
a new GSimpleAction |
Since 2.28
GSimpleAction * g_simple_action_new_stateful (const gchar *name, const GVariantType *parameter_type, GVariant *state);
Creates a new stateful action.
state
is the initial state of the action. All future state values
must have the same GVariantType as the initial state.
If the state
GVariant is floating, it is consumed.
|
the name of the action |
|
the type of the parameter to the activate function. allow-none. |
|
the initial state of the action |
Returns : |
a new GSimpleAction |
Since 2.28
void g_simple_action_set_enabled (GSimpleAction *simple, gboolean 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.
|
a GSimpleAction |
|
whether the action is enabled |
Since 2.28