Class BoxLayout
- All Implemented Interfaces:
Orientable,Proxy
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 org.gnome.gtk.LayoutManager
LayoutManager.LayoutManager$Impl, LayoutManager.LayoutManagerClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.Orientable$Impl, Orientable.OrientableIface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new BoxLayout.BoxLayout(MemorySegment address) Create a BoxLayout proxy instance for the provided memory address.BoxLayout(Orientation orientation) Creates a newGtkBoxLayout. -
Method Summary
Modifier and TypeMethodDescriptionprotected BoxLayoutasParent()Returns 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.intReturns the space that this BoxLayout puts between children.static @Nullable TypegetType()Get the GType of the BoxLayout classvoidsetBaselineChild(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 org.gnome.gtk.LayoutManager
allocate, createLayoutChild, getLayoutChild, getMemoryLayout, getRequestMode, getRequestMode, getWidget, layoutChanged, measure, root, unrootMethods inherited from class org.gnome.gobject.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 org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Orientable
getOrientation, setOrientation
-
Constructor Details
-
BoxLayout
Create a BoxLayout proxy 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()Creates a new BoxLayout.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParentin classLayoutManager
-
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
-