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

Method focusableInThis

core/widgetevents.go:514–524  ·  view source on GitHub ↗

focusableInThis returns the first Focusable element within this widget

()

Source from the content-addressed store, hash-verified

512
513// focusableInThis returns the first Focusable element within this widget
514func (wb *WidgetBase) focusableInThis() Widget {
515 var foc Widget
516 wb.WidgetWalkDown(func(cw Widget, cwb *WidgetBase) bool {
517 if !cwb.AbilityIs(abilities.Focusable) {
518 return tree.Continue
519 }
520 foc = cw
521 return tree.Break // done
522 })
523 return foc
524}
525
526// focusNext moves the focus onto the next item
527func (wb *WidgetBase) focusNext() {

Callers 2

SetFocusMethod · 0.95
SetFocusEventMethod · 0.95

Calls 2

WidgetWalkDownMethod · 0.95
AbilityIsMethod · 0.45

Tested by

no test coverage detected