Class GridLayout
- All Implemented Interfaces:
Proxy
Children have an "attach point" defined by the horizontal and vertical
index of the cell they occupy; children can span multiple rows or columns.
The layout properties for setting the attach points and spans are set
using the GridLayoutChild associated to each child widget.
The behaviour of GtkGridLayout when several children occupy the same
grid cell is undefined.
GtkGridLayout can be used like a GtkBoxLayout if all children are
attached to the same row or column; however, if you only ever need a
single row or column, you should consider using GtkBoxLayout.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGridLayout.Builder<B extends GridLayout.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested 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.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new GridLayout.GridLayout(MemorySegment address) Create a GridLayout proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected GridLayoutasParent()Returns this instance as if it were its parent type.static GridLayout.Builder<? extends GridLayout.Builder> builder()AGridLayout.Builderobject constructs aGridLayoutwith the specified properties.intRetrieves the row set with gtk_grid_layout_set_baseline_row().booleanChecks whether all columns of this GridLayout should have the same width.intRetrieves the spacing set with gtk_grid_layout_set_column_spacing().getRowBaselinePosition(int row) Returns the baseline position ofrow.booleanChecks whether all rows of this GridLayout should have the same height.intRetrieves the spacing set with gtk_grid_layout_set_row_spacing().static @Nullable TypegetType()Get the GType of the GridLayout classvoidsetBaselineRow(int row) Sets which row defines the global baseline for the entire grid.voidsetColumnHomogeneous(boolean homogeneous) Sets whether all columns of this GridLayout should have the same width.voidsetColumnSpacing(int spacing) Sets the amount of space to insert between consecutive columns.voidsetRowBaselinePosition(int row, BaselinePosition pos) Sets how the baseline should be positioned onrowof the grid, in case that row is assigned more space than is requested.voidsetRowHomogeneous(boolean homogeneous) Sets whether all rows of this GridLayout should have the same height.voidsetRowSpacing(int spacing) Sets the amount of space to insert between consecutive rows.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, hashCode
-
Constructor Details
-
GridLayout
Create a GridLayout proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
GridLayout
public GridLayout()Creates a new GridLayout.
-
-
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
-
getBaselineRow
public int getBaselineRow()Retrieves the row set with gtk_grid_layout_set_baseline_row().- Returns:
- the global baseline row
-
getColumnHomogeneous
public boolean getColumnHomogeneous()Checks whether all columns of this GridLayout should have the same width.- Returns:
trueif the columns are homogeneous, andfalseotherwise
-
getColumnSpacing
public int getColumnSpacing()Retrieves the spacing set with gtk_grid_layout_set_column_spacing().- Returns:
- the spacing between consecutive columns
-
getRowBaselinePosition
Returns the baseline position ofrow.If no value has been set with
setRowBaselinePosition(int, org.gnome.gtk.BaselinePosition), the default value ofBaselinePosition.CENTERis returned.- Parameters:
row- a row index- Returns:
- the baseline position of
row
-
getRowHomogeneous
public boolean getRowHomogeneous()Checks whether all rows of this GridLayout should have the same height.- Returns:
trueif the rows are homogeneous, andfalseotherwise
-
getRowSpacing
public int getRowSpacing()Retrieves the spacing set with gtk_grid_layout_set_row_spacing().- Returns:
- the spacing between consecutive rows
-
setBaselineRow
public void setBaselineRow(int row) Sets which row defines the global baseline for the entire grid.Each row in the grid can have its own local baseline, but only one of those is global, meaning it will be the baseline in the parent of the
grid.- Parameters:
row- the row index
-
setColumnHomogeneous
public void setColumnHomogeneous(boolean homogeneous) Sets whether all columns of this GridLayout should have the same width.- Parameters:
homogeneous-trueto make columns homogeneous
-
setColumnSpacing
public void setColumnSpacing(int spacing) Sets the amount of space to insert between consecutive columns.- Parameters:
spacing- the amount of space between columns, in pixels
-
setRowBaselinePosition
Sets how the baseline should be positioned onrowof the grid, in case that row is assigned more space than is requested.- Parameters:
row- a row indexpos- aGtkBaselinePosition
-
setRowHomogeneous
public void setRowHomogeneous(boolean homogeneous) Sets whether all rows of this GridLayout should have the same height.- Parameters:
homogeneous-trueto make rows homogeneous
-
setRowSpacing
public void setRowSpacing(int spacing) Sets the amount of space to insert between consecutive rows.- Parameters:
spacing- the amount of space between rows, in pixels
-
builder
AGridLayout.Builderobject constructs aGridLayoutwith the specified properties. Use the variousset...()methods to set properties, and finish construction withGridLayout.Builder.build().- Returns:
- the builder object
-