menuBar([bar])

Class: Window.

Description:

Sets or gets the main menu bar for the top of the Window. On macOS, this menu bar appears in the system's top menu bar.

Parameters:

Name Type Description

[bar]

MenuBar

The MenuBar to set as the primary menu bar.

Returns:

Returns the Window instance when setting a menu bar; otherwise, returns the currently set MenuBar, or undefined if none is set.

Type: Window | MenuBar | undefined