MenuBar
classin packageklyn.gui.windows
public class MenuBar extends Widget:
└ MenuBar

Menu bar of a window.

bar = MenuBar()
bar.addMenu(Menu("File"))
window.menuBar = bar
Inherited Properties
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
Inherited Events
eventInherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public MenuBar No summary.
Methods
Modifier and Type Member Description
public activateMnemonic
activateMnemonic(key as String) as Boolean:
Opens the top-level menu matching an Alt mnemonic.
public addMenu
addMenu(menu as Menu) as Void:
Adds a top-level menu.
public closeOpenMenu
closeOpenMenu() as Void:
Closes the currently opened menu and clears transient hover state.
public handleKeyPressed
handleKeyPressed(key as String) as Boolean:
Handles keyboard navigation while a menu popup is opened.
public menus
menus() as List<Menu>:
Returns top-level menus.
public override paint
paint(painter as Painter) as Void:
No summary.
public override paintOverlay
paintOverlay(painter as Painter) as Void:
No summary.
public popupContainsPoint
popupContainsPoint(x as Int, y as Int) as Boolean:
Returns true when a point falls inside the currently open popup.
public removeMenu
removeMenu(menu as Menu) as Boolean:
Removes a top-level menu.
public override resolvePreferredHeight
resolvePreferredHeight() as Int:
Resolved menu-bar height after runtime content zoom.
Inherited Methods
methodInherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds