MCPcopy Create free account
hub / github.com/cogentcore/core / SetState

Method SetState

core/flags.go:25–32  ·  view source on GitHub ↗

SetState sets the given [states.State] flags to the given value.

(on bool, state ...states.States)

Source from the content-addressed store, hash-verified

23
24// SetState sets the given [states.State] flags to the given value.
25func (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.

Callers 15

handleWidgetClickMethod · 0.95
StyleMethod · 0.95
SetSelectedMethod · 0.95
SetEnabledMethod · 0.95
SetReadOnlyMethod · 0.95
RenderWidgetMethod · 0.45
InitMethod · 0.45
setBranchStateMethod · 0.45
setChildrenVisibilityMethod · 0.45
contextMenuMethod · 0.45

Calls 1

SetFlagMethod · 0.65

Tested by 1