kvision / pl.treksoft.kvision.electron / Menu

Menu

open external class Menu

Constructors

<init>

Menu()

Properties

items

open var items: Array<MenuItem>

Functions

addListener

open fun addListener(event: String, listener: (event: Event) -> Unit): Menu
open fun addListener(event: String, listener: (event: Event) -> Unit): Menu

append

open fun append(menuItem: MenuItem): Unit

closePopup

open fun closePopup(browserWindow: BrowserWindow? = definedExternally): Unit

getMenuItemById

open fun getMenuItemById(id: String): MenuItem

insert

open fun insert(pos: Number, menuItem: MenuItem): Unit

on

open fun on(event: String, listener: (event: Event) -> Unit): Menu
open fun on(event: String, listener: (event: Event) -> Unit): Menu

once

open fun once(event: String, listener: (event: Event) -> Unit): Menu
open fun once(event: String, listener: (event: Event) -> Unit): Menu

popup

open fun popup(options: PopupOptions): Unit

removeListener

open fun removeListener(event: String, listener: (event: Event) -> Unit): Menu
open fun removeListener(event: String, listener: (event: Event) -> Unit): Menu

Companion Object Functions

buildFromTemplate

fun buildFromTemplate(template: Array<MenuItemConstructorOptions>): Menu

getApplicationMenu

fun getApplicationMenu(): Menu?

sendActionToFirstResponder

fun sendActionToFirstResponder(action: String): Unit

setApplicationMenu

fun setApplicationMenu(menu: Menu?): Unit

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.