Package: gio

Function gio:simple-action-new

Lambda List

gio:simple-action-new (name vtype)

Arguments

name -- a string with the name of the action
vtype -- a g:variant-type parameter type or a type string for the parameter to the activate function

Return Value

The new g:simple-action object.

Details

Creates a new action. The created action is stateless. See the g:simple-action-new-stateful function for a stateful action.

Notes

A type string for the vtype argument is converted to the g:variant-type parameter type with the g:variant-type-new function.

Examples

A simple action with no parameter type.
(defvar action (g:simple-action-new "clear" nil)) => ACTION
(g:action-name action) => "clear"
(g:action-enabled action) => T
(g:action-parameter-type action) => NIL
(g:action-state action) => #.(SB-SYS:INT-SAP #X00000000)
(g:action-state-type action) => NIL    
A simple action with a string parameter type.
(setf action (g:simple-action-new "check" "s"))
=> #<G-SIMPLE-ACTION {10022B4AF3}>
(g:action-name action) => "check"
(g:action-enabled action) => T
(g:action-parameter-type action) => #<G-VARIANT-TYPE {10022B5AB3}>
(g:action-state action) => #.(SB-SYS:INT-SAP #X00000000)
(g:action-state-type action) => NIL    
 

See also

2024-12-29