Package: gio

Accessor g-action-state

Lambda List

g-action-state (object)

Syntax

(g-action-state object) => state
(setf (g-action-state object) state)

Arguments

object -- a g-action object
state -- a g-variant state of the action

Details

Accessor of the state slot of the g-action class.

Queries the current state of the action. If the action is not stateful then a null-pointer will be returned. If the action is stateful then the type of the return value is the type given by the g-action-state-type function.

Examples

A stateful action with an integer value.
(defvar state (g-variant-new-int32 123)) => STATE
(defvar action (g-simple-action-new-stateful "stateful" nil state)) => ACTION
(g-action-state action) => #.(SB-SYS:INT-SAP #X560FD04EFE10)
(g-variant-int32 *) => 123
(setf (g-action-state action) (g-variant-new-int32 999))
=> #.(SB-SYS:INT-SAP #X560FD04F2C40)
(g-action-state action) => #.(SB-SYS:INT-SAP #X560FD04F2C40)
(g-variant-int32 *) =>999    
A simple action with no state returns a null-pointer value.
(setf action (g-simple-action-new "simple" nil))
=>  #<G-SIMPLE-ACTION {1004B2CE73}>
(g-action-state *) => #.(SB-SYS:INT-SAP #X00000000)    
 

See also

*2021-12-10