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

Method initialize

gui/list.go:76–96  ·  view source on GitHub ↗
(vert bool, width, height float32)

Source from the content-addressed store, hash-verified

74}
75
76func (li *List) initialize(vert bool, width, height float32) {
77
78 li.styles = &StyleDefault().List
79 li.single = true
80
81 li.ItemScroller.initialize(vert, width, height)
82 li.ItemScroller.SetStyles(li.styles.Scroller)
83 li.ItemScroller.adjustItem = true
84 li.ItemScroller.Subscribe(OnKeyDown, li.onKeyEvent)
85 li.ItemScroller.Subscribe(OnKeyRepeat, li.onKeyEvent)
86
87 if vert {
88 li.keyNext = window.KeyDown
89 li.keyPrev = window.KeyUp
90 } else {
91 li.keyNext = window.KeyRight
92 li.keyPrev = window.KeyLeft
93 }
94
95 li.update()
96}
97
98// SetSingle sets the single/multiple selection flag of the list
99func (li *List) SetSingle(state bool) {

Callers 8

NewImageLabelFunction · 0.45
InitializeMethod · 0.45
newTreeNodeFunction · 0.45
newWindowTitleFunction · 0.45
insertRowMethod · 0.45
InitializeMethod · 0.45
NewEditFunction · 0.45
newListFunction · 0.45

Calls 4

updateMethod · 0.95
StyleDefaultFunction · 0.85
SubscribeMethod · 0.65
SetStylesMethod · 0.45

Tested by

no test coverage detected