(vert bool, width, height float32)
| 74 | } |
| 75 | |
| 76 | func (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 |
| 99 | func (li *List) SetSingle(state bool) { |
no test coverage detected