applyContextMenus adds the [Widget.ContextMenus] to the given menu scene in reverse order. It also adds separators between each context menu function.
(m *Scene)
| 135 | // applyContextMenus adds the [Widget.ContextMenus] to the given menu scene |
| 136 | // in reverse order. It also adds separators between each context menu function. |
| 137 | func (wb *WidgetBase) applyContextMenus(m *Scene) { |
| 138 | for i := len(wb.ContextMenus) - 1; i >= 0; i-- { |
| 139 | wb.ContextMenus[i](m) |
| 140 | |
| 141 | nc := m.NumChildren() |
| 142 | // we delete any extra separator |
| 143 | if nc > 0 { |
| 144 | if _, ok := m.Child(nc - 1).(*Separator); ok { |
| 145 | m.DeleteChildAt(nc - 1) |
| 146 | } |
| 147 | } |
| 148 | if i != 0 { |
| 149 | NewSeparator(m) |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | // ContextMenuPos returns the default position for the context menu |
| 155 | // upper left corner. The event will be from a mouse ContextMenu |
nothing calls this directly
no test coverage detected