Documentation
¶
Overview ¶
A horizontal menu bar that creates a menu for each PopupMenu child. New items are created by adding PopupMenus to this node. Item title is determined by Window.Title, or node name if Window.Title is empty. Item title can be overridden using SetMenuTitle.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsMenuBar() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Flat() bool
- func (self Instance) GetMenuCount() int
- func (self Instance) GetMenuPopup(menu int) PopupMenu.Instance
- func (self Instance) GetMenuTitle(menu int) string
- func (self Instance) GetMenuTooltip(menu int) string
- func (self Instance) ID() ID
- func (self Instance) IsMenuDisabled(menu int) bool
- func (self Instance) IsMenuHidden(menu int) bool
- func (self Instance) IsNativeMenu() bool
- func (self Instance) Language() string
- func (self Instance) PreferGlobalMenu() bool
- func (self Instance) SetDisableShortcuts(disabled bool)
- func (self Instance) SetFlat(value bool)
- func (self Instance) SetLanguage(value string)
- func (self Instance) SetMenuDisabled(menu int, disabled bool)
- func (self Instance) SetMenuHidden(menu int, hidden bool)
- func (self Instance) SetMenuTitle(menu int, title string)
- func (self Instance) SetMenuTooltip(menu int, tooltip string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPreferGlobalMenu(value bool)
- func (self Instance) SetStartIndex(value int)
- func (self Instance) SetSwitchOnHover(value bool)
- func (self Instance) SetTextDirection(value Control.TextDirection)
- func (self Instance) StartIndex() int
- func (self Instance) SwitchOnHover() bool
- func (self Instance) TextDirection() Control.TextDirection
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) GetMenuCount ¶
Returns number of menu items.
func (Instance) GetMenuPopup ¶
Returns PopupMenu associated with menu item.
func (Instance) GetMenuTitle ¶
Returns menu item title.
func (Instance) GetMenuTooltip ¶
Returns menu item tooltip.
func (Instance) IsMenuDisabled ¶
Returns true, if menu item is disabled.
func (Instance) IsMenuHidden ¶
Returns true, if menu item is hidden.
func (Instance) IsNativeMenu ¶
Returns true, if system global menu is supported and used by this MenuBar.
func (Instance) Language ¶
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
func (Instance) PreferGlobalMenu ¶
If true, MenuBar will use system global menu when supported.
Note: If true and global menu is supported, this node is not displayed, has zero size, and all its child nodes except PopupMenus are inaccessible.
Note: This property overrides the value of the PopupMenu.PreferNativeMenu property of the child nodes.
func (Instance) SetDisableShortcuts ¶
If true, shortcuts are disabled and cannot be used to trigger the button.
func (Instance) SetLanguage ¶
SetLanguage sets the property returned by [GetLanguage].
func (Instance) SetMenuDisabled ¶
If true, menu item is disabled.
func (Instance) SetMenuHidden ¶
If true, menu item is hidden.
func (Instance) SetMenuTitle ¶
Sets menu item title.
func (Instance) SetMenuTooltip ¶
Sets menu item tooltip.
func (Instance) SetPreferGlobalMenu ¶
SetPreferGlobalMenu sets the property returned by [IsPreferGlobalMenu].
func (Instance) SetStartIndex ¶
SetStartIndex sets the property returned by [GetStartIndex].
func (Instance) SetSwitchOnHover ¶
SetSwitchOnHover sets the property returned by [IsSwitchOnHover].
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(value Control.TextDirection)
SetTextDirection sets the property returned by [GetTextDirection].
func (Instance) StartIndex ¶
Position order in the global menu to insert MenuBar items at. All menu items in the MenuBar are always inserted as a continuous range. Menus with lower StartIndex are inserted first. Menus with StartIndex equal to -1 are inserted last.
func (Instance) SwitchOnHover ¶
If true, when the cursor hovers above menu item, it will close the current PopupMenu and open the other one.
func (Instance) TextDirection ¶
func (self Instance) TextDirection() Control.TextDirection
Base text writing direction.