Class GridLayout

All Implemented Interfaces:
PointerInterface

public class GridLayout extends LayoutManager
`GtkGridLayout` is a layout manager which arranges child widgets in
rows and columns.

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 [class@Gtk.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`.

https://docs.gtk.org/gtk4/class.GridLayout.html

  • Constructor Details

    • GridLayout

      public GridLayout(PointerContainer pointer)
    • GridLayout

      public GridLayout()
      Creates a new `GtkGridLayout`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • 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 @grid should have the same width.
      Returns:
      %TRUE if the columns are homogeneous, and %FALSE otherwise
    • getColumnSpacing

      public int getColumnSpacing()
      Retrieves the spacing set with gtk_grid_layout_set_column_spacing().
      Returns:
      the spacing between consecutive columns
    • getRowBaselinePosition

      public int getRowBaselinePosition(int row)
      Returns the baseline position of @row.

      If no value has been set with
      [method@Gtk.GridLayout.set_row_baseline_position],
      the default value of %GTK_BASELINE_POSITION_CENTER
      is returned.
      Parameters:
      row - a row index
      Returns:
      the baseline position of @row
    • getRowHomogeneous

      public boolean getRowHomogeneous()
      Checks whether all rows of @grid should have the same height.
      Returns:
      %TRUE if the rows are homogeneous, and %FALSE otherwise
    • 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 @grid should have the same width.
      Parameters:
      homogeneous - %TRUE to 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

      public void setRowBaselinePosition(int row, int pos)
      Sets how the baseline should be positioned on @row of the
      grid, in case that row is assigned more space than is requested.
      Parameters:
      row - a row index
      pos - a `GtkBaselinePosition`
    • setRowHomogeneous

      public void setRowHomogeneous(boolean homogeneous)
      Sets whether all rows of @grid should have the same height.
      Parameters:
      homogeneous - %TRUE to 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
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()