initialize initializes this scroller and can be called by other types which embed a scroller
(width, height float32, mode ScrollMode, target IPanel)
| 96 | |
| 97 | // initialize initializes this scroller and can be called by other types which embed a scroller |
| 98 | func (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 |
| 113 | func (s *Scroller) SetScrollMode(mode ScrollMode) { |
no test coverage detected