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

Method AddOption

gui/menu.go:164–172  ·  view source on GitHub ↗

AddOption creates and adds a new menu item to this menu with the specified text and returns the pointer to the created menu item.

(text string)

Source from the content-addressed store, hash-verified

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.
164func (m *Menu) AddOption(text string) *MenuItem {
165
166 mi := newMenuItem(text, m.styles.Item)
167 m.Panel.Add(mi)
168 m.items = append(m.items, mi)
169 mi.menu = m
170 m.recalc()
171 return mi
172}
173
174// AddSeparator creates and adds a new separator to the menu
175func (m *Menu) AddSeparator() *MenuItem {

Callers 1

buildMenuFunction · 0.95

Calls 3

recalcMethod · 0.95
newMenuItemFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected