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
object Companion

Properties

Link copied to clipboard
val id: String

The id of this item.

Link copied to clipboard
Link copied to clipboard
val rid: Double

Functions

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

Add a menu item to the end of this submenu.

Link copied to clipboard

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
fun get(id: String): Promise<Any?>

Retrieves the menu item matching the given identifier.

Link copied to clipboard
fun <T : Any> insert(items: T, position: Double): Promise<Void>
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

Returns whether this submenu is enabled or not.

Link copied to clipboard

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

Link copied to clipboard
fun popup(at: LogicalPosition = definedExternally, window: Window = definedExternally): Promise<Void>
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
fun <T : Any> prepend(items: T): Promise<Void>
fun <T : Any> prepend(items: ReadonlyArray<T>): Promise<Void>

Add a menu item to the beginning of this submenu.

Link copied to clipboard
fun remove(item: Submenu): Promise<Void>

Remove a menu item from this submenu.

Link copied to clipboard
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
fun setEnabled(enabled: Boolean): Promise<Void>

Sets whether this submenu is enabled or not.

Link copied to clipboard

Sets an icon for this submenu

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

Sets the text for this submenu.

Link copied to clipboard

Returns the text of this submenu.