MCPcopy Create free account
hub / github.com/cogentcore/core / ShowContextMenu

Method ShowContextMenu

core/menu.go:171–179  ·  view source on GitHub ↗
(e events.Event)

Source from the content-addressed store, hash-verified

169}
170
171func (wb *WidgetBase) ShowContextMenu(e events.Event) {
172 e.SetHandled() // always
173 wi := wb.This.(Widget)
174 nm := NewMenu(wi.AsWidget().applyContextMenus, wi, wi.ContextMenuPos(e))
175 if nm == nil { // no items
176 return
177 }
178 nm.Run()
179}
180
181// NewMenuFromStrings constructs a new menu from given list of strings,
182// calling the given function with the index of the selected string.

Callers

nothing calls this directly

Calls 5

NewMenuFunction · 0.85
SetHandledMethod · 0.65
AsWidgetMethod · 0.65
ContextMenuPosMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected