MenuBar
A horizontal menu bar that creates a MenuButton
for each PopupMenu
child.
class MenuBar
A horizontal menu bar that creates a MenuButton
for each PopupMenu
child. New items are created by adding PopupMenu
s to this node.
Superclasses
class Control
Base class for all GUI controls. Adapts its position and size based on its parent control.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var flat: Bool
Flat
MenuBar
don’t display item decoration.var language: String
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
var preferGlobalMenu: Bool
If
true
,MenuBar
will use system global menu when supported.var startIndex: Int32
Position in the global menu to insert first
MenuBar
item at.var switchOnHover: Bool
If
true
, when the cursor hovers above menu item, it will close the currentPopupMenu
and open the other one.var textDirection: Control.TextDirection
Base text writing direction.
func getMenuCount(
) -> Int32 Returns number of menu items.
func isNativeMenu(
) -> Bool Returns
true
, if system global menu is supported and used by thisMenuBar
.func setDisableShortcuts(disabled: Bool
) If
true
, shortcuts are disabled and cannot be used to trigger the button.