ContextMenuBuilder

builds the entries of a menu, see Element.contextMenu and MenuBar

Functions

Link copied to clipboard
fun item(label: String, action: () -> Unit)

adds an item labeled label that calls action when it is clicked

fun item(label: String, shortcut: String, action: () -> Unit)

adds an item labeled label with the keyboard shortcut, like mod+s, which a menu bar registers

Link copied to clipboard
fun separator()

adds a line between items

Link copied to clipboard
fun submenu(label: String, builder: ContextMenuBuilder.() -> Unit)

adds a submenu labeled label, it opens when the pointer is over it