genSwitch function
Return an on/off switch widget
This is used to create an on/off switch widget. When the switch changes value
the changeExec
function if it exists will be called.
The defValue
is the initial value and assumes it matches the SamHot sym
setting.
This can be guaranteed by specifying defValue:sm.getHot(sym)
and making sure
the SamHot value of sym
in sm
has a true or false value.
The label
adds a label to the switch.
Implementation
Widget genSwitch(SamModel sm,String sym,Object label,{bool defValue = false,CheckFunc changeExec}) {
return _LabeledSwitch(sm,sym,label,defValue,changeExec);
}