Menu

Signature:

export class Menu extends Component implements CloseableComponent 

Extends: Component

Implements: CloseableComponent

Constructors

ConstructorModifiersDescription
(constructor)()Constructs a new instance of the Menu class

Methods

MethodModifiersDescription
addChild(component)

Adds a child component, loading it if this component is loaded

(Inherited from Component)

addItem(cb)Adds a menu item. Only works when menu is not shown yet.
addSeparator()Adds a separator. Only works when menu is not shown yet.
close()
hide()
load()

Load this component and its children

(Inherited from Component)

onHide(callback)
onload()

Override this to load your component

(Inherited from Component)

onunload()

Override this to unload your component

(Inherited from Component)

register(cb)

Registers a callback to be called when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerDomEvent(el, type, callback, options)

Registers an DOM event to be detached when unloading

(Inherited from Component)

registerEvent(eventRef)

Registers an event to be detached when unloading

(Inherited from Component)

registerInterval(id)

Registers an interval (from setInterval) to be cancelled when unloading Use instead of to avoid TypeScript confusing between NodeJS vs Browser API

(Inherited from Component)

removeChild(component)

Removes a child component, unloading it

(Inherited from Component)

setNoIcon()
setUseNativeMenu(useNativeMenu)Force this menu to use native or DOM. (Only works on the desktop app)
showAtMouseEvent(evt)
showAtPosition(position, doc)
unload()

Unload this component and its children

(Inherited from Component)