Package: gtk

Function gtk:action-group-add-radio-actions

Lambda List

gtk:action-group-add-radio-actions (group entries value on-change)

Arguments

group -- a gtk:action-group object
entries -- a list of radio action descriptions
value -- an integer with the value of the action to activate initially, or -1 if no action should be activated
on-change -- a callback function to connect to the changed signal

Details

This is a convenience function to create a group of radio actions and add them to the action group. The "changed" signal of the first radio action is connected to the on-change callback function and the accel paths of the actions are set to <Actions>/group-name/action-name.

Examples

(let ((group (gtk:action-group-new "AppWindowActions"))
      (actions '(("Red" nil                      ; name, stock id
                  "_Red" "<control>R"            ; label, accelerator
                  "Blood" 0)                     ; tooltip, value
                 ("Green" nil                    ; name, stock id
                  "_Green" "<control>G"          ; label, accelerator
                  "Grass" 1)                     ; tooltip, value
                 ("Blue" nil                     ; name, stock id
                  "_Blue" "<control>B"           ; label, accelerator
                  "Sky" 2))))
    (gtk:action-group-add-radio-actions group actions 0 nil)
    ... )    

Warning

The gtk:action-group-add-radio-actions function has been deprecated since version 3.10 and should not be used in newly written code.
 

See also

2024-9-24