Class BoxLayout
- All Implemented Interfaces:
Proxy
,Orientable
GtkBoxLayout
is a layout manager that 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
Modifier and TypeClassDescriptionstatic class
static class
BoxLayout.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.LayoutManagerClass, LayoutManager.LayoutManagerImpl
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.OrientableIface, Orientable.OrientableImpl
-
Constructor Summary
ConstructorDescriptionBoxLayout
(MemorySegment address) Create a BoxLayout proxy instance for the provided memory address.BoxLayout
(Orientation orientation) Creates a newGtkBoxLayout
. -
Method Summary
Modifier and TypeMethodDescriptionprotected BoxLayout
asParent()
Returns this instance as if it were its parent type.static BoxLayout.Builder
<? extends BoxLayout.Builder> builder()
ABoxLayout.Builder
object constructs aBoxLayout
with the specified properties.int
Gets the value set by gtk_box_layout_set_baseline_child().Gets the value set by gtk_box_layout_set_baseline_position().boolean
Returns whether the layout is set to be homogeneous.int
Returns the space that this BoxLayout puts between children.static Type
getType()
Get the GType of the BoxLayout classvoid
setBaselineChild
(int child) Sets the index of the child that determines the baseline in vertical layout.void
setBaselinePosition
(BaselinePosition position) Sets the baseline position of a box layout.void
setHomogeneous
(boolean homogeneous) Sets whether the box layout will allocate the same size to all children.void
setSpacing
(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, unroot
Methods 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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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:
asParent
in 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
-
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:
true
if 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
-
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
position
is 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
-true
to 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.Builder
object constructs aBoxLayout
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withBoxLayout.Builder.build()
.
-