Package: gio
Class g-simple-action
SuperclassesDocumented Subclasses
None
Direct SlotsDetails A g-simple-action object is the obvious simple implementation of the g-action interface.
This is the easiest way to create an action for purposes of adding it to a g-simple-action-group object. Signal DetailsThe "activate" signallambda (action parameter) :run-lastIndicates that the action was just activated. The argument parameter will always be of the expected type. In the event that an incorrect type was given, no signal will be emitted.
The "change-state" signallambda (action value) :run-lastIndicates that the action just received a request to change its state. The argument value will always be of the correct state type. In the event that an incorrect type was given, no signal will be emitted. If no handler is connected to this signal then the default behaviour is to call the function g-simple-action-state to set the state to the requested value. If you connect a signal handler then no default action is taken. If the state should change then you must call the function g-simple-action-state from the handler. Example: Implementation of a "change-state" handler (g-signal-connect action "change-state" (lambda (action value) (let ((requested (g-variant-int32 value))) ;; Volume only goes from 0 to 10 (when (and (>= requested 0) (<= requested 10)) (setf (g-simple-action-state action) value)))))The handler need not set the state to the requested value. It could set it to any value at all, or take some other action.
| Slot Access Functions
Inherited Slot Access Functions
See also |
2021-8-1