MenuBar

package
v0.0.0-...-9b8b246 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 27 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsMenuBar() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsMenuBar

func (self *Extension[T]) AsMenuBar() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.MenuBar

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 New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsMenuBar

func (self Instance) AsMenuBar() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) Flat

func (self Instance) Flat() bool

Flat MenuBar don't display item decoration.

func (Instance) GetMenuCount

func (self Instance) GetMenuCount() int

Returns number of menu items.

func (Instance) GetMenuPopup

func (self Instance) GetMenuPopup(menu int) PopupMenu.Instance

Returns PopupMenu associated with menu item.

func (Instance) GetMenuTitle

func (self Instance) GetMenuTitle(menu int) string

Returns menu item title.

func (Instance) GetMenuTooltip

func (self Instance) GetMenuTooltip(menu int) string

Returns menu item tooltip.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsMenuDisabled

func (self Instance) IsMenuDisabled(menu int) bool

Returns true, if menu item is disabled.

func (Instance) IsMenuHidden

func (self Instance) IsMenuHidden(menu int) bool

Returns true, if menu item is hidden.

func (Instance) IsNativeMenu

func (self Instance) IsNativeMenu() bool

Returns true, if system global menu is supported and used by this MenuBar.

func (Instance) Language

func (self Instance) Language() string

Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.

func (Instance) PreferGlobalMenu

func (self Instance) PreferGlobalMenu() bool

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

func (self Instance) SetDisableShortcuts(disabled bool)

If true, shortcuts are disabled and cannot be used to trigger the button.

func (Instance) SetFlat

func (self Instance) SetFlat(value bool)

SetFlat sets the property returned by [IsFlat].

func (Instance) SetLanguage

func (self Instance) SetLanguage(value string)

SetLanguage sets the property returned by [GetLanguage].

func (Instance) SetMenuDisabled

func (self Instance) SetMenuDisabled(menu int, disabled bool)

If true, menu item is disabled.

func (Instance) SetMenuHidden

func (self Instance) SetMenuHidden(menu int, hidden bool)

If true, menu item is hidden.

func (Instance) SetMenuTitle

func (self Instance) SetMenuTitle(menu int, title string)

Sets menu item title.

func (Instance) SetMenuTooltip

func (self Instance) SetMenuTooltip(menu int, tooltip string)

Sets menu item tooltip.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPreferGlobalMenu

func (self Instance) SetPreferGlobalMenu(value bool)

SetPreferGlobalMenu sets the property returned by [IsPreferGlobalMenu].

func (Instance) SetStartIndex

func (self Instance) SetStartIndex(value int)

SetStartIndex sets the property returned by [GetStartIndex].

func (Instance) SetSwitchOnHover

func (self Instance) SetSwitchOnHover(value bool)

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

func (self Instance) StartIndex() int

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

func (self Instance) SwitchOnHover() bool

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.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL