Menu
class in package klyn.gui.windows

    public class Menu extends Widget:

Widget
└ Menu

A drop-down menu.

    file = Menu("&File")
    file.addItem(MenuItem("&Open..."))
    file.addSeparator()
    file.addItem(MenuItem("E&xit"))

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | title `title as String = ""` | Text displayed for a top-level menu or submenu entry.

Inherited Properties
property Inherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Inherited Events
event Inherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | Menu `Menu(title as String = ""):` | Creates an empty menu.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | addItem `addItem(item as MenuItem) as Void:` | Appends an action or submenu item.
public | addMenu `addMenu(menu as Menu, icon as String = "") as MenuItem:` | Appends a submenu and returns its owning menu item.
public | addSeparator `addSeparator() as Void:` | Appends a visual separator between two logical action groups.
public | items `items() as List<MenuItem>:` | Returns the entries in display order.
public | removeItem `removeItem(item as MenuItem) as Boolean:` | Removes one entry.

Inherited Methods
method Inherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds