Menu
classin packageklyn.gui.windows
public class Menu extends 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
propertyInherited Properties from Widget: accentColor, acceptFileDrops, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, 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
eventInherited Events from Widget: filesDropped, focusGained, focusLost, 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
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFilesDropped, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintForeground, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds