Package: gio

Function g-simple-action-new

Lambda List

g-simple-action-new (name vtype)

Arguments

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

Return Value

A 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.

Note

A type string for the vtype argument is converted to the g-variant-type 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

*2021-10-31