class MenuBar
- Extends:
- UIComponent
Description:
MenuBar UI component is used to create a menu bar at the top of the application. It extends UIComponent class.
Menu bar can be added to Window in two ways, by setting the MenuBar as the Window's main menu bar using window.menuBar(menuBar) method, or adding the MenuBar object as any other UI component using menuBar.addTo(window) or window.addChild(menuBar).
Using window.menuBar(menuBar) automatically positions and resizes the menu bar to Window's width and in MacOS it uses it as the main menu bar shows at the top menu bar of the operating system.
Adding the menu bar as a regular UI component to Window will keep the menu inside the Window and you will have to resize it by setting the desired width (and optionally height).
Only Menu objects can be added to MenuBar.
Constructor
constructor([text])
Constructor of MenuBar UI component.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
string |
Text displayed in the menu |
Members
- [ readonly ] childCount
- [ readonly ] children
- [ readonly ] container
- [ readonly ] id
- [ readonly ] parent
- [ readonly ] screenPosition
Methods
Inherited from UIComponent:
- addChild()
- addTo()
- anchor()
- background()
- bottom()
- center()
- child()
- childIndex()
- cursor()
- destroy()
- dragAction()
- dragData()
- dragDataType()
- dropAction()
- dropDataType()
- emit()
- emitFocusKeyEvents()
- enabled()
- focusable()
- focused()
- font()
- getAncestor()
- getWindow()
- height()
- hide()
- index()
- isInside()
- layer()
- maxSize()
- minSize()
- move()
- onAncestorEvents()
- onComponentEvents()
- onContainerEvents()
- onDispose()
- onDragEvents()
- onDropEvents()
- onError()
- onFocusEvents()
- onKey()
- onMouseEvents()
- onMouseMotion()
- onMouseWheel()
- onPropertyChange()
- opacity()
- position()
- remove()
- right()
- size()
- snapshot()
- text()
- tooltip()
- updateUI()
- verifyComponent()
- visible()
- width()
- x()
- y()
