Add a radio group (:add_radio)
Declaration
dialog_obj = dialog_obj:add_radio(label, options [, default_option])
Parameters
- label
String. Title text for the radio group - options
Table. Ordered list of option names; names must be unique - default_option
String, optional. Selected option name. Default: first option
Returns
- dialog_obj
Dialog. Returns the dialog itself - :show() return type
String. The selected option name
Description
Add a radio group to the dialog
Example
local c, s = dialog():add_radio('A radio group', {'R1', 'R2', 'R3'}):show()
sys.alert('Your choice: ' .. s['A radio group'])
Note: Uses function outside this chapter sys.alert
Full example
See :show()