Class BoxLayout
- All Implemented Interfaces:
Orientable, Proxy
Arranges children in a single row or column.
Whether it is a row or column depends on the value of its
Gtk.Orientable:orientation property. Within the other dimension
all children all allocated the same size. The GtkBoxLayout will respect
the Gtk.Widget:halign and Gtk.Widget:valign
properties of each child widget.
If you want all children to be assigned the same size, you can use
the Gtk.BoxLayout:homogeneous property.
If you want to specify the amount of space placed between each child,
you can use the Gtk.BoxLayout:spacing property.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classBoxLayout.Builder<B extends BoxLayout.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class LayoutManager
LayoutManager.LayoutManager$Impl, LayoutManager.LayoutManagerClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface Orientable
Orientable.Orientable$Impl, Orientable.OrientableIface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new BoxLayout.BoxLayout(MemorySegment address) Create a BoxLayout instance for the provided memory address.BoxLayout(Orientation orientation) Creates a newGtkBoxLayout. -
Method Summary
Modifier and TypeMethodDescriptionprotected BoxLayoutasParent()Return this instance as if it were its parent type.static BoxLayout.Builder<? extends BoxLayout.Builder> builder()ABoxLayout.Builderobject constructs aBoxLayoutwith the specified properties.intGets the value set by gtk_box_layout_set_baseline_child().Gets the value set by gtk_box_layout_set_baseline_position().booleanReturns whether the layout is set to be homogeneous.static MemoryLayoutThe memory layout of the native struct.intReturns the space that this BoxLayout puts between children.static @Nullable TypegetType()Get the GType of the BoxLayout class.voidsetBaselineChild(int child) Sets the index of the child that determines the baseline in vertical layout.voidsetBaselinePosition(BaselinePosition position) Sets the baseline position of a box layout.voidsetHomogeneous(boolean homogeneous) Sets whether the box layout will allocate the same size to all children.voidsetSpacing(int spacing) Sets how much spacing to put between children.Methods inherited from class LayoutManager
allocate, createLayoutChild, getLayoutChild, getRequestMode, getRequestMode, getWidget, layoutChanged, measure, root, unrootMethods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Orientable
getOrientation, setOrientation
-
Constructor Details
-
BoxLayout
Create a BoxLayout instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
BoxLayout
Creates a newGtkBoxLayout.- Parameters:
orientation- the orientation for the new layout
-
BoxLayout
public BoxLayout()Create a new BoxLayout.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classLayoutManager- Returns:
- the instance as if it were its parent type
-
getBaselineChild
public int getBaselineChild()Gets the value set by gtk_box_layout_set_baseline_child().- Returns:
- the index of the child that determines the baseline in vertical layout, or -1
- Since:
- 4.12
-
getBaselinePosition
Gets the value set by gtk_box_layout_set_baseline_position().- Returns:
- the baseline position
-
getHomogeneous
public boolean getHomogeneous()Returns whether the layout is set to be homogeneous.- Returns:
trueif the layout is homogeneous
-
getSpacing
public int getSpacing()Returns the space that this BoxLayout puts between children.- Returns:
- the spacing of the layout
-
setBaselineChild
public void setBaselineChild(int child) Sets the index of the child that determines the baseline in vertical layout.- Parameters:
child- the child position, or -1- Since:
- 4.12
-
setBaselinePosition
Sets the baseline position of a box layout.
The baseline position affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not allocated by the parent then the given
positionis used to allocate the baseline within the extra space available.- Parameters:
position- aGtkBaselinePosition
-
setHomogeneous
public void setHomogeneous(boolean homogeneous) Sets whether the box layout will allocate the same size to all children.- Parameters:
homogeneous-trueto set the box layout as homogeneous
-
setSpacing
public void setSpacing(int spacing) Sets how much spacing to put between children.- Parameters:
spacing- the spacing to apply between children
-
builder
ABoxLayout.Builderobject constructs aBoxLayoutwith the specified properties. Use the variousset...()methods to set properties, and finish construction withBoxLayout.Builder.build().- Returns:
- the builder object
-