Package: gio

Accessor gio:action-state

Lambda List

gio: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 parameter for the 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 cffi:null-pointer value 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.
(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 cffi: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

2025-2-3