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

Function NewMenu

gui/menu.go:150–160  ·  view source on GitHub ↗

NewMenu creates and returns a pointer to a new empty vertical menu

()

Source from the content-addressed store, hash-verified

148
149// NewMenu creates and returns a pointer to a new empty vertical menu
150func 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.

Callers 2

NewMenuBarFunction · 0.85
buildMenuFunction · 0.85

Calls 4

StyleDefaultFunction · 0.85
SubscribeMethod · 0.65
InitializeMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected