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

Method ScrollToThis

core/scroll.go:272–281  ·  view source on GitHub ↗

ScrollToThis tells this widget's parent frame to scroll to keep this widget in view. It returns whether any scrolling was done.

()

Source from the content-addressed store, hash-verified

270// ScrollToThis tells this widget's parent frame to scroll to keep
271// this widget in view. It returns whether any scrolling was done.
272func (wb *WidgetBase) ScrollToThis() bool {
273 if wb.This == nil {
274 return false
275 }
276 fr := wb.parentScrollFrame()
277 if fr == nil {
278 return false
279 }
280 return fr.scrollToWidget(wb.This.(Widget))
281}
282
283// scrollToWidget scrolls the layout to ensure that the given widget is in view.
284// It returns whether scrolling was needed.

Callers 12

OpenURLMethod · 0.80
moveDownEventMethod · 0.80
moveUpEventMethod · 0.80
movePageUpEventMethod · 0.80
movePageDownEventMethod · 0.80
moveHomeEventMethod · 0.80
moveEndEventMethod · 0.80
dragMoveMethod · 0.80
setFocusMethod · 0.80
setFocusEventMethod · 0.80
selectionMonitorMethod · 0.80

Calls 2

parentScrollFrameMethod · 0.95
scrollToWidgetMethod · 0.80

Tested by

no test coverage detected