MCPcopy
hub / github.com/g3n/engine / initialize

Method initialize

gui/scroller.go:98–110  ·  view source on GitHub ↗

initialize initializes this scroller and can be called by other types which embed a scroller

(width, height float32, mode ScrollMode, target IPanel)

Source from the content-addressed store, hash-verified

96
97// initialize initializes this scroller and can be called by other types which embed a scroller
98func (s *Scroller) initialize(width, height float32, mode ScrollMode, target IPanel) {
99
100 s.Panel.Initialize(s, width, height)
101 s.style = &StyleDefault().Scroller
102 s.target = target
103 s.Panel.Add(s.target)
104 s.mode = mode
105
106 s.Subscribe(OnResize, s.onResize)
107 s.Subscribe(OnScroll, s.onScroll)
108
109 s.Update()
110}
111
112// SetScrollMode sets the scroll mode
113func (s *Scroller) SetScrollMode(mode ScrollMode) {

Callers 1

NewScrollerFunction · 0.45

Calls 5

UpdateMethod · 0.95
StyleDefaultFunction · 0.85
SubscribeMethod · 0.65
InitializeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected