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

Method parentScrollFrame

core/scroll.go:258–268  ·  view source on GitHub ↗

parentScrollFrame returns the first parent frame that has active scrollbars.

()

Source from the content-addressed store, hash-verified

256
257// parentScrollFrame returns the first parent frame that has active scrollbars.
258func (wb *WidgetBase) parentScrollFrame() *Frame {
259 ly := tree.ParentByType[Layouter](wb)
260 if ly == nil {
261 return nil
262 }
263 fr := ly.AsFrame()
264 if fr.hasAnyScroll() {
265 return fr
266 }
267 return fr.parentScrollFrame()
268}
269
270// ScrollToThis tells this widget's parent frame to scroll to keep
271// this widget in view. It returns whether any scrolling was done.

Callers 1

ScrollToThisMethod · 0.95

Calls 2

hasAnyScrollMethod · 0.80
AsFrameMethod · 0.65

Tested by

no test coverage detected