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

Method ContextMenuPos

core/menu.go:157–162  ·  view source on GitHub ↗

ContextMenuPos returns the default position for the context menu upper left corner. The event will be from a mouse ContextMenu event if non-nil: should handle both cases.

(e events.Event)

Source from the content-addressed store, hash-verified

155// upper left corner. The event will be from a mouse ContextMenu
156// event if non-nil: should handle both cases.
157func (wb *WidgetBase) ContextMenuPos(e events.Event) image.Point {
158 if e != nil {
159 return e.WindowPos()
160 }
161 return wb.winPos(.5, .5) // center
162}
163
164func (wb *WidgetBase) handleWidgetContextMenu() {
165 wb.On(events.ContextMenu, func(e events.Event) {

Callers

nothing calls this directly

Calls 2

winPosMethod · 0.95
WindowPosMethod · 0.65

Tested by

no test coverage detected