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

Function widgetNext

core/widget.go:456–468  ·  view source on GitHub ↗

widgetNext returns the next widget in the tree, including Parts, which are considered to come after Children. returns nil if no more.

(w Widget)

Source from the content-addressed store, hash-verified

454// including Parts, which are considered to come after Children.
455// returns nil if no more.
456func widgetNext(w Widget) Widget {
457 wb := w.AsWidget()
458 if !wb.HasChildren() && wb.Parts == nil {
459 return widgetNextSibling(w)
460 }
461 if wb.HasChildren() {
462 return wb.Child(0).(Widget)
463 }
464 if wb.Parts != nil {
465 return widgetNext(wb.Parts.This.(Widget))
466 }
467 return nil
468}
469
470// widgetNextSibling returns next sibling or nil if none,
471// including Parts, which are considered to come after Children.

Callers 1

widgetNextFuncFunction · 0.85

Calls 4

widgetNextSiblingFunction · 0.85
ChildMethod · 0.80
AsWidgetMethod · 0.65
HasChildrenMethod · 0.45

Tested by

no test coverage detected