SetChecked sets whether the switch it checked.
(on bool)
| 222 | |
| 223 | // SetChecked sets whether the switch it checked. |
| 224 | func (sw *Switch) SetChecked(on bool) *Switch { |
| 225 | sw.SetState(on, states.Checked) |
| 226 | sw.SetState(false, states.Indeterminate) |
| 227 | return sw |
| 228 | } |
| 229 | |
| 230 | // updateStackTop updates the [Frame.StackTop] of the stack in the switch |
| 231 | // according to the current icon. It is called automatically to keep the |