SetState sets the given [states.State] flags to the given value.
(on bool, state ...states.States)
| 23 | |
| 24 | // SetState sets the given [states.State] flags to the given value. |
| 25 | func (wb *WidgetBase) SetState(on bool, state ...states.States) *WidgetBase { |
| 26 | bfs := make([]enums.BitFlag, len(state)) |
| 27 | for i, st := range state { |
| 28 | bfs[i] = st |
| 29 | } |
| 30 | wb.Styles.State.SetFlag(on, bfs...) |
| 31 | return wb |
| 32 | } |
| 33 | |
| 34 | // SetSelected sets the [states.Selected] flag to given value for the entire Widget |
| 35 | // and calls [WidgetBase.Restyle] to apply any resultant style changes. |