AddContextMenu adds the given context menu to [WidgetBase.ContextMenus]. It is the main way that code should modify a widget's context menus. Context menu functions are run in reverse order, and separators are automatically added between each context menu function.
(menu func(m *Scene))
| 129 | // Context menu functions are run in reverse order, and separators are |
| 130 | // automatically added between each context menu function. |
| 131 | func (wb *WidgetBase) AddContextMenu(menu func(m *Scene)) { |
| 132 | wb.ContextMenus = append(wb.ContextMenus, menu) |
| 133 | } |
| 134 | |
| 135 | // applyContextMenus adds the [Widget.ContextMenus] to the given menu scene |
| 136 | // in reverse order. It also adds separators between each context menu function. |