Constructor

GioSimpleActionnew_stateful

Declaration

GSimpleAction*
g_simple_action_new_stateful (
  const gchar* name,
  const GVariantType* parameter_type,
  GVariant* state
)

Description

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.

Available since:2.28

Parameters

name const gchar*
 

The name of the action.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
parameter_type GVariantType
 

The type of the parameter that will be passed to handlers for the GSimpleAction::activate signal, or NULL for no parameter.

 The argument can be NULL.
 The data is owned by the caller of the function.
state GVariant
 

The initial state of the action.

 The data is owned by the caller of the function.

Return value

Returns: GSimpleAction
 

A new GSimpleAction.

 The caller of the function takes ownership of the data, and is responsible for freeing it.