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

Method HasStateWithin

core/flags.go:72–82  ·  view source on GitHub ↗

HasStateWithin returns whether this widget or any of its children have the given state flag.

(state states.States)

Source from the content-addressed store, hash-verified

70// HasStateWithin returns whether this widget or any
71// of its children have the given state flag.
72func (wb *WidgetBase) HasStateWithin(state states.States) bool {
73 got := false
74 wb.WidgetWalkDown(func(cw Widget, cwb *WidgetBase) bool {
75 if cwb.StateIs(state) {
76 got = true
77 return tree.Break
78 }
79 return tree.Continue
80 })
81 return got
82}

Callers

nothing calls this directly

Calls 2

WidgetWalkDownMethod · 0.95
StateIsMethod · 0.80

Tested by

no test coverage detected