FoldableContainer

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

A container that can be expanded/collapsed, with a title that can be filled with controls, such as buttons.

The title can be positioned at the top or bottom of the container.

The container can be expanded or collapsed by clicking the title or by pressing ui_accept when focused.

Child control nodes are hidden when the container is collapsed. Ignores non-control children.

Can allow grouping with other FoldableContainers, check FoldableGroup and FoldableGroup.

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
	AsFoldableContainer() 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]) AsContainer

func (self *Extension[T]) AsContainer() Container.Instance

func (*Extension[T]) AsControl

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

func (*Extension[T]) AsFoldableContainer

func (self *Extension[T]) AsFoldableContainer() 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.FoldableContainer

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) AddTitleBarControl

func (self Instance) AddTitleBarControl(control Control.Instance)

Adds a Control that will be placed next to the container's title, obscuring the clickable area. Prime usage is adding Button nodes, but it can be any Control.

The control will be added as a child of this container and removed from previous parent if necessary. The controls will be placed aligned to the right, with the first added control being the leftmost one.

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsContainer

func (self Instance) AsContainer() Container.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsFoldableContainer

func (self Instance) AsFoldableContainer() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) Expand

func (self Instance) Expand()

Expands the container and emits OnFoldingChanged.

func (Instance) Fold

func (self Instance) Fold()

Folds the container and emits OnFoldingChanged.

func (Instance) Folded

func (self Instance) Folded() bool

If true, the container will becomes folded and will hide all its children.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Language

func (self Instance) Language() string

Language code used for text shaping algorithms. If left empty, current locale is used instead.

func (Instance) OnFoldingChanged

func (self Instance) OnFoldingChanged(cb func(is_folded bool), flags ...Signal.Flags)

Emitted when the container is folded/expanded.

func (Instance) RemoveTitleBarControl

func (self Instance) RemoveTitleBarControl(control Control.Instance)

Removes a Control added with AddTitleBarControl. The node is not freed automatically, you need to use Node.QueueFree.

func (Instance) SetFolded

func (self Instance) SetFolded(value bool)

SetFolded sets the property returned by [IsFolded].

func (Instance) SetLanguage

func (self Instance) SetLanguage(value string)

SetLanguage sets the property returned by [GetLanguage].

func (*Instance) SetObject

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

func (Instance) SetTitle

func (self Instance) SetTitle(value string)

SetTitle sets the property returned by [GetTitle].

func (Instance) SetTitleAlignment

func (self Instance) SetTitleAlignment(value GUI.HorizontalAlignment)

SetTitleAlignment sets the property returned by [GetTitleAlignment].

func (Instance) SetTitlePosition

func (self Instance) SetTitlePosition(value TitlePosition)

SetTitlePosition sets the property returned by [GetTitlePosition].

func (Instance) SetTitleTextDirection

func (self Instance) SetTitleTextDirection(value Control.TextDirection)

SetTitleTextDirection sets the property returned by [GetTitleTextDirection].

func (Instance) SetTitleTextOverrunBehavior

func (self Instance) SetTitleTextOverrunBehavior(value TextServer.OverrunBehavior)

SetTitleTextOverrunBehavior sets the property returned by [GetTitleTextOverrunBehavior].

func (Instance) Title

func (self Instance) Title() string

The container's title text.

func (Instance) TitleAlignment

func (self Instance) TitleAlignment() GUI.HorizontalAlignment

Title's horizontal text alignment.

func (Instance) TitlePosition

func (self Instance) TitlePosition() TitlePosition

Title's position.

func (Instance) TitleTextDirection

func (self Instance) TitleTextDirection() Control.TextDirection

Title text writing direction.

func (Instance) TitleTextOverrunBehavior

func (self Instance) TitleTextOverrunBehavior() TextServer.OverrunBehavior

Defines the behavior of the title when the text is longer than the available space.

func (Instance) Virtual

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

type TitlePosition

type TitlePosition int //gd:FoldableContainer.TitlePosition
const (
	// Makes the title appear at the top of the container.
	PositionTop TitlePosition = 0
	// Makes the title appear at the bottom of the container. Also makes all StyleBoxes flipped vertically.
	PositionBottom TitlePosition = 1
)

Jump to

Keyboard shortcuts

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