tui.checkbox
tui.checkbox ID PANE ROW LABEL [CHECKED] [ACTION]
Creates a checkbox.
Parameters
CHECKED:1,trueoryesto start checked. Anything else starts unchecked.ACTION: function called asACTION ID VALUEafter each toggle: the checkbox id, then the new value0or1.
Returns: 1 when ID or PANE is empty.
Notes
- The id comes first, as for every widget callback, so one function can handle a whole group of checkboxes.
tui.getprints0/1;tui.get.checkedworks in conditions.
Example
tui.checkbox chk_wrap opts 0 "Wrap lines" 1 on_opt
tui.checkbox chk_times opts 1 "Show times" 0 on_opt
on_opt() { # ID VALUE
case "$1" in
chk_wrap) tui.config.set my.wrap "$2" ;;
chk_times) tui.config.set my.times "$2" ;;
esac
}
See also: tui.checkbox.toggle
