Skip to content
Matthias Görges edited this page Jul 14, 2016 · 5 revisions

The uiform radiobox element creates a radiobox toggle.

Parameter Default Description
id #f Variable to store radiobox state in
location 'db Radiobox state storage location
text #f Text shown to the left of the radiobox
color White Font color
left #f (list "label" value (action-fcn)) on left selection
right #f (list "label" value (action-fcn)) on right selection

Example

Example 1: A complete page definition with a radiobox and label string depending on the radiobox state, shortened from LNhealth's apps/WidgetDemo

(ex_boxes
"Radio/Check Boxes"
  ("Prev" ex_labels #f)
  ("Next" ex_checklists #f)
  (spacer)
  (label text "Choose one:" align center)
  (spacer)
  (radiobox id dummy_radio location ui left ("Yes" 1 #f) right ("No" 2 #f))
  (spacer)
  ,(lambda () 
     (let ((value (uiget 'dummy_radio 0)))
      `(label text ,(cond ((= value 0) "No choice made")
                          ((= value 1) "You chose: Yes")
                          ((= value 2) "You chose: No")) align center)))
)
Clone this wiki locally