NewMenu creates and returns a pointer to a new empty vertical menu
()
| 148 | |
| 149 | // NewMenu creates and returns a pointer to a new empty vertical menu |
| 150 | func NewMenu() *Menu { |
| 151 | |
| 152 | m := new(Menu) |
| 153 | m.Panel.Initialize(m, 0, 0) |
| 154 | m.styles = &StyleDefault().Menu |
| 155 | m.items = make([]*MenuItem, 0) |
| 156 | m.Panel.Subscribe(OnKeyDown, m.onKey) |
| 157 | m.Panel.Subscribe(OnResize, m.onResize) |
| 158 | m.update() |
| 159 | return m |
| 160 | } |
| 161 | |
| 162 | // AddOption creates and adds a new menu item to this menu with the |
| 163 | // specified text and returns the pointer to the created menu item. |
no test coverage detected