Companion

external object Companion(source)

Functions

Link copied to clipboard
external fun buildFromTemplate(template: ReadonlyArray<Any>): Menu

Generally, the template is an array of options for constructing a MenuItem. The usage can be referenced above.

Link copied to clipboard
external fun getApplicationMenu(): Menu?

The application menu, if set, or null, if not set.

Link copied to clipboard
external fun sendActionToFirstResponder(action: String)

Sends the action to the first responder of application. This is used for emulating default macOS menu behaviors. Usually you would use the role property of a MenuItem.

Link copied to clipboard
external fun setApplicationMenu(menu: Menu?)

Sets menu as the application menu on macOS. On Windows and Linux, the menu will be set as each window's top menu.

Link copied to clipboard

Sets the colors used to highlight the hovered or keyboard-focused item in every menu the app shows, including context menus and the menu bar's dropdowns. Light and dark colors are set separately, and any color left unset keeps the default for that mode. Each call replaces the colors set by any previous call. Passing null restores the defaults.