NewContextMenuWithShortcuts creates a new context menu component with custom shortcuts.
(title string, actions []string, shortcuts []rune, onAction func(index int, action string))
| 27 | |
| 28 | // NewContextMenuWithShortcuts creates a new context menu component with custom shortcuts. |
| 29 | func NewContextMenuWithShortcuts(title string, actions []string, shortcuts []rune, onAction func(index int, action string)) *ContextMenu { |
| 30 | return &ContextMenu{ |
| 31 | menuItems: actions, |
| 32 | shortcuts: shortcuts, |
| 33 | title: title, |
| 34 | onAction: onAction, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // SetApp sets the parent app reference. |
| 39 | func (cm *ContextMenu) SetApp(app *App) { |
no outgoing calls
no test coverage detected