Submenu

open external class Submenu : MenuItemBase(source)

A type that is a submenu inside a {@linkcode Menu} or {@linkcode Submenu}.

Constructors

Link copied to clipboard
constructor(rid: Double, id: String)

Types

Link copied to clipboard
external object Companion

Properties

Link copied to clipboard
external val id: String

The id of this item.

Link copied to clipboard
external val kind: String
Link copied to clipboard
external val rid: Double

Functions

Link copied to clipboard
external fun <T : Any> append(items: T): Promise<Void>
external fun <T : Any> append(items: ReadonlyArray<T>): Promise<Void>

Add a menu item to the end of this submenu.

Link copied to clipboard
external fun close(): Promise<Void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Link copied to clipboard
external fun get(id: String): Promise<Any?>

Retrieves the menu item matching the given identifier.

Link copied to clipboard
external fun <T : Any> insert(items: T, position: Double): Promise<Void>
external fun <T : Any> insert(items: ReadonlyArray<T>, position: Double): Promise<Void>

Add a menu item to the specified position in this submenu.

Link copied to clipboard
external fun isEnabled(): Promise<Boolean>

Returns whether this submenu is enabled or not.

Link copied to clipboard
external fun items(): Promise<ReadonlyArray<Any>>

Returns a list of menu items that has been added to this submenu.

Link copied to clipboard
external fun popup(): Promise<Void>
external fun popup(at: LogicalPosition = definedExternally, window: Window = definedExternally): Promise<Void>
external fun popup(at: PhysicalPosition = definedExternally, window: Window = definedExternally): Promise<Void>

Popup this submenu as a context menu on the specified window.

Link copied to clipboard
external fun <T : Any> prepend(items: T): Promise<Void>
external fun <T : Any> prepend(items: ReadonlyArray<T>): Promise<Void>

Add a menu item to the beginning of this submenu.

Link copied to clipboard
external fun remove(item: CheckMenuItem): Promise<Void>
external fun remove(item: IconMenuItem): Promise<Void>
external fun remove(item: MenuItem): Promise<Void>
external fun remove(item: PredefinedMenuItem): Promise<Void>
external fun remove(item: Submenu): Promise<Void>

Remove a menu item from this submenu.

Link copied to clipboard
external fun removeAt(position: Double): Promise<Any?>

Remove a menu item from this submenu at the specified position.

Link copied to clipboard

Set this submenu as the Help menu for the application on macOS.

Link copied to clipboard

Set this submenu as the Window menu for the application on macOS.

Link copied to clipboard
external fun setEnabled(enabled: Boolean): Promise<Void>

Sets whether this submenu is enabled or not.

Link copied to clipboard
external fun setIcon(icon: MenuIcon?): Promise<Void>

Sets an icon for this submenu

Link copied to clipboard
external fun setText(text: String): Promise<Void>

Sets the text for this submenu.

Link copied to clipboard
external fun text(): Promise<String>

Returns the text of this submenu.