- Editor.Menu
- Methods
- Editor.Menu.popup (template[, x, y])
- Editor.Menu.register (name, tmpl[, force])
- Editor.Menu.walk (template, fn)
Methods
template array|object - Menu template for initialize. The template take the options of Electron's Menu Itemx number - The position xy number - The position y
Send menu:popup to main process.
name string - The name of the register menutmpl object - Menu templateforce boolean - Force to register a menu even it was registered before.
Send menu:register to main process.
template array|object - Menu template.fn functoin - Function applied to each menu item
Example:
Editor.Menu.walk(menuTmpl, item => { if ( item.params ) { item.params.unshift('Hello'); } if (item.message === 'foobar:say-hello') { item.enabled = false; }});