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

Method SetState

styles/style.go:334–341  ·  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

332
333// SetState sets the given [states.State] flags to the given value
334func (s *Style) SetState(on bool, state ...states.States) *Style {
335 bfs := make([]enums.BitFlag, len(state))
336 for i, st := range state {
337 bfs[i] = st
338 }
339 s.State.SetFlag(on, bfs...)
340 return s
341}
342
343// SetEnabled sets the Disabled State flag according to given bool
344func (s *Style) SetEnabled(on bool) *Style {

Callers 14

TestFormStyleFunction · 0.95
SetReadOnlyMethod · 0.95
VCSContextMenuMethod · 0.45
contextMenuMethod · 0.45
makeColumnsMethod · 0.45
handleElementFunction · 0.45
MakeRowMethod · 0.45
inputsFunction · 0.45
slidersFunction · 0.45
MakeToolbarMethod · 0.45
handleFocusMethod · 0.45
handleMouseMethod · 0.45

Calls 1

SetFlagMethod · 0.65

Tested by 1

TestFormStyleFunction · 0.76