Search code examples
rebolrebol3r3-gui

How to get radio button selection in Rebol 3?


How do I get the value a user selects in a radio button group? Here is a simple code, what should I add in order to be able to retrieve the user selection? I couldn't find it in the docs.

view [
    radio "First"
    radio "Second"
    radio "Third"
]

Solution

  • probably not the only way, but you can set an external variable, as in

    x: 0  
    view [
      radio "First" on-action [set 'x 1]
      radio "Second" on-action [set 'x   2]
      radio "Third" on-action [set 'x 3]
    ]
    print x