SplitContainer

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: 27 Imported by: 0

Documentation

Overview

A container that accepts only two child controls, then arranges them horizontally or vertically and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls.

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
	AsSplitContainer() Instance
}

type DraggerVisibility

type DraggerVisibility int //gd:SplitContainer.DraggerVisibility
const (
	// The split dragger icon is always visible when theme's 'autohide' is false, otherwise visible only when the cursor hovers it.
	//
	// The size of the grabber icon determines the minimum theme's 'separation'.
	//
	// The dragger icon is automatically hidden if the length of the grabber icon is longer than the split bar.
	DraggerVisible DraggerVisibility = 0
	// The split dragger icon is never visible regardless of the value of theme's 'autohide'.
	//
	// The size of the grabber icon determines the minimum theme's 'separation'.
	DraggerHidden DraggerVisibility = 1
	// The split dragger icon is not visible, and the split bar is collapsed to zero thickness.
	DraggerHiddenCollapsed DraggerVisibility = 2
)

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]) AsNode

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

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsSplitContainer

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

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.SplitContainer

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

func (self Instance) AsContainer() Container.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) AsSplitContainer

func (self Instance) AsSplitContainer() Instance

func (Instance) ClampSplitOffset

func (self Instance) ClampSplitOffset()

Clamps the SplitOffset value to not go outside the currently possible minimal and maximum values.

func (Instance) Collapsed

func (self Instance) Collapsed() bool

If true, the dragger will be disabled and the children will be sized as if the SplitOffset was 0.

func (Instance) DragAreaHighlightInEditor

func (self Instance) DragAreaHighlightInEditor() bool

Highlights the drag area Rect2.PositionSize so you can see where it is during development. The drag area is gold if DraggingEnabled is true, and red if false.

func (Instance) DragAreaMarginBegin

func (self Instance) DragAreaMarginBegin() int

Reduces the size of the drag area and split bar theme's 'split_bar_background' at the beginning of the container.

func (Instance) DragAreaMarginEnd

func (self Instance) DragAreaMarginEnd() int

Reduces the size of the drag area and split bar theme's 'split_bar_background' at the end of the container.

func (Instance) DragAreaOffset

func (self Instance) DragAreaOffset() int

Shifts the drag area in the axis of the container to prevent the drag area from overlapping the ScrollBar or other selectable Control of a child node.

func (Instance) DraggerVisibility

func (self Instance) DraggerVisibility() DraggerVisibility

Determines the dragger's visibility. This property does not determine whether dragging is enabled or not. Use DraggingEnabled for that.

func (Instance) DraggingEnabled

func (self Instance) DraggingEnabled() bool

Enables or disables split dragging.

func (Instance) GetDragAreaControl

func (self Instance) GetDragAreaControl() Control.Instance

Returns the drag area Control. For example, you can move a pre-configured button into the drag area Control so that it rides along with the split bar. Try setting the Button anchors to center prior to the reparent() call.

barnacleButton.AsNode().Reparent(splitContainer.GetDragAreaControl().AsNode())

Note: The drag area Control is drawn over the SplitContainer's children, so CanvasItem draw objects called from the Control and children added to the Control will also appear over the SplitContainer's children. Try setting Control.MouseFilter of custom children to [Control.MouseFilterIgnore] to prevent blocking the mouse from dragging if desired.

Warning: This is a required internal node, removing and freeing it may cause a crash.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnDragEnded

func (self Instance) OnDragEnded(cb func(), flags ...Signal.Flags)

Emitted when the user ends dragging.

func (Instance) OnDragStarted

func (self Instance) OnDragStarted(cb func(), flags ...Signal.Flags)

Emitted when the user starts dragging.

func (Instance) OnDragged

func (self Instance) OnDragged(cb func(offset int), flags ...Signal.Flags)

Emitted when the dragger is dragged by user.

func (Instance) SetCollapsed

func (self Instance) SetCollapsed(value bool)

SetCollapsed sets the property returned by [IsCollapsed].

func (Instance) SetDragAreaHighlightInEditor

func (self Instance) SetDragAreaHighlightInEditor(value bool)

SetDragAreaHighlightInEditor sets the property returned by [IsDragAreaHighlightInEditorEnabled].

func (Instance) SetDragAreaMarginBegin

func (self Instance) SetDragAreaMarginBegin(value int)

SetDragAreaMarginBegin sets the property returned by [GetDragAreaMarginBegin].

func (Instance) SetDragAreaMarginEnd

func (self Instance) SetDragAreaMarginEnd(value int)

SetDragAreaMarginEnd sets the property returned by [GetDragAreaMarginEnd].

func (Instance) SetDragAreaOffset

func (self Instance) SetDragAreaOffset(value int)

SetDragAreaOffset sets the property returned by [GetDragAreaOffset].

func (Instance) SetDraggerVisibility

func (self Instance) SetDraggerVisibility(value DraggerVisibility)

SetDraggerVisibility sets the property returned by [GetDraggerVisibility].

func (Instance) SetDraggingEnabled

func (self Instance) SetDraggingEnabled(value bool)

SetDraggingEnabled sets the property returned by [IsDraggingEnabled].

func (*Instance) SetObject

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

func (Instance) SetSplitOffset

func (self Instance) SetSplitOffset(value int)

SetSplitOffset sets the property returned by [GetSplitOffset].

func (Instance) SetTouchDraggerEnabled

func (self Instance) SetTouchDraggerEnabled(value bool)

SetTouchDraggerEnabled sets the property returned by [IsTouchDraggerEnabled].

func (Instance) SetVertical

func (self Instance) SetVertical(value bool)

SetVertical sets the property returned by [IsVertical].

func (Instance) SplitOffset

func (self Instance) SplitOffset() int

The initial offset of the splitting between the two Controls, with 0 being at the end of the first Control.

func (Instance) TouchDraggerEnabled

func (self Instance) TouchDraggerEnabled() bool

If true, a touch-friendly drag handle will be enabled for better usability on smaller screens. Unlike the standard grabber, this drag handle overlaps the SplitContainer's children and does not affect their minimum separation. The standard grabber will no longer be drawn when this option is enabled.

func (Instance) Vertical

func (self Instance) Vertical() bool

If true, the SplitContainer will arrange its children vertically, rather than horizontally.

Can't be changed when using HSplitContainer and VSplitContainer.

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