This example shows how the cx-create-button-box, cx-create-toggle-button, and cx-set-toggle-button macros work. In the cx-create-button-box statement the radio-mode argument is set to #t which indicates that
radio buttons are being used, not check boxes. Once all four radio
buttons are created, a cx-set-toggle-button macro is used to set radioButton2 to #t, meaning that this option button will be selected
when the dialog box is opened. Since these are radio buttons and not
check boxes, this is the only button in the button box that can be
selected. If you select any other button, radioButton2 will automatically be deselected.

(define apply-cb #t) (define update-cb #f) (define radioButton1) (define radioButton2) (define radioButton3) (define radioButton4) (define my-dialog-box (cx-create-panel "My Dialog Box" apply-cb update-cb)) (define table (cx-create-table my-dialog-box "This is an example Dialog Box")) (define buttonBox (cx-create-button-box table "Button Box" 'radio-mode #t)) (set! radioButton1 (cx-create-toggle-button buttonBox "Radio Button 1")) (set! radioButton2 (cx-create-toggle-button buttonBox "Radio Button 2")) (set! radioButton3 (cx-create-toggle-button buttonBox "Radio Button 3")) (set! radioButton4 (cx-create-toggle-button buttonBox "Radio Button 4")) (cx-set-toggle-button radioButton2 #t) (cx-show-panel my-dialog-box)
To view additional examples of radio buttons, see Comprehensive Examples.