gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.GridLayout

Contents

- Exported types
- Methods
  - getBaselineRow
  - getColumnHomogeneous
  - getColumnSpacing
  - getRowBaselinePosition
  - getRowHomogeneous
  - getRowSpacing
  - new
  - setBaselineRow
  - setColumnHomogeneous
  - setColumnSpacing
  - setRowBaselinePosition
  - setRowHomogeneous
  - setRowSpacing
- Properties
  - baselineRow
  - columnHomogeneous
  - columnSpacing
  - rowHomogeneous
  - rowSpacing

Description

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 `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`.

Synopsis

- newtype GridLayout = GridLayout (ManagedPtr GridLayout)
- class (GObject o, IsDescendantOf GridLayout o) => IsGridLayout o
- toGridLayout :: (MonadIO m, IsGridLayout o) => o -> m GridLayout
- gridLayoutGetBaselineRow :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> m Int32
- gridLayoutGetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> m Bool
- gridLayoutGetColumnSpacing :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> m Word32
- gridLayoutGetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Int32 -> m BaselinePosition
- gridLayoutGetRowHomogeneous :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> m Bool
- gridLayoutGetRowSpacing :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> m Word32
- gridLayoutNew :: (HasCallStack, MonadIO m) => m GridLayout
- gridLayoutSetBaselineRow :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Int32 -> m ()
- gridLayoutSetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Bool -> m ()
- gridLayoutSetColumnSpacing :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Word32 -> m ()
- gridLayoutSetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Int32 -> BaselinePosition -> m ()
- gridLayoutSetRowHomogeneous :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Bool -> m ()
- gridLayoutSetRowSpacing :: (HasCallStack, MonadIO m, IsGridLayout a) => a -> Word32 -> m ()
- constructGridLayoutBaselineRow :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridLayoutBaselineRow :: (MonadIO m, IsGridLayout o) => o -> m Int32
- setGridLayoutBaselineRow :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m ()
- constructGridLayoutColumnHomogeneous :: (IsGridLayout o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGridLayoutColumnHomogeneous :: (MonadIO m, IsGridLayout o) => o -> m Bool
- setGridLayoutColumnHomogeneous :: (MonadIO m, IsGridLayout o) => o -> Bool -> m ()
- constructGridLayoutColumnSpacing :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridLayoutColumnSpacing :: (MonadIO m, IsGridLayout o) => o -> m Int32
- setGridLayoutColumnSpacing :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m ()
- constructGridLayoutRowHomogeneous :: (IsGridLayout o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGridLayoutRowHomogeneous :: (MonadIO m, IsGridLayout o) => o -> m Bool
- setGridLayoutRowHomogeneous :: (MonadIO m, IsGridLayout o) => o -> Bool -> m ()
- constructGridLayoutRowSpacing :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getGridLayoutRowSpacing :: (MonadIO m, IsGridLayout o) => o -> m Int32
- setGridLayoutRowSpacing :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m ()

# Exported types

newtype GridLayout Source #

Memory-managed wrapper type.

Constructors

GridLayout (ManagedPtr GridLayout) |

#### Instances

Instances details

Eq GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout Methods (==) :: GridLayout -> GridLayout -> Bool Source # (/=) :: GridLayout -> GridLayout -> Bool Source #
GObject GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout
ManagedPtrNewtype GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout Methods toManagedPtr :: GridLayout -> ManagedPtr GridLayout Source #
TypedObject GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout Methods glibType :: IO GType Source #
HasParentTypes GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout
IsGValue (Maybe GridLayout) Source # | Convert `GridLayout` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.GridLayout Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe GridLayout -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GridLayout) Source #
type ParentTypes GridLayout Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout type ParentTypes GridLayout = '[LayoutManager, Object]

class (GObject o, IsDescendantOf GridLayout o) => IsGridLayout o Source #

Type class for types which can be safely cast to `GridLayout`, for instance with `toGridLayout`.

#### Instances

Instances details

(GObject o, IsDescendantOf GridLayout o) => IsGridLayout o Source # |
Instance details Defined in GI.Gtk.Objects.GridLayout

toGridLayout :: (MonadIO m, IsGridLayout o) => o -> m GridLayout Source #

Cast to `GridLayout`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

allocate, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, layoutChanged, measure, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getBaselineRow, getColumnHomogeneous, getColumnSpacing, getData, getLayoutChild, getProperty, getQdata, getRequestMode, getRowBaselinePosition, getRowHomogeneous, getRowSpacing, getWidget.

#### Setters

setBaselineRow, setColumnHomogeneous, setColumnSpacing, setData, setDataFull, setProperty, setRowBaselinePosition, setRowHomogeneous, setRowSpacing.

## getBaselineRow

gridLayoutGetBaselineRow Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> m Int32 | Returns: the global baseline row

Retrieves the row set with `gridLayoutSetBaselineRow`.

## getColumnHomogeneous

gridLayoutGetColumnHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> m Bool | Returns: `True` if the columns are homogeneous, and `False` otherwise

Checks whether all columns of `grid` should have the same width.

## getColumnSpacing

gridLayoutGetColumnSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> m Word32 | Returns: the spacing between consecutive columns

Retrieves the spacing set with `gridLayoutSetColumnSpacing`.

## getRowBaselinePosition

gridLayoutGetRowBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Int32 | `row`: a row index
-> m BaselinePosition | Returns: the baseline position of `row`

Returns the baseline position of `row`.

If no value has been set with `gridLayoutSetRowBaselinePosition`, the default value of `BaselinePositionCenter` is returned.

## getRowHomogeneous

gridLayoutGetRowHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> m Bool | Returns: `True` if the rows are homogeneous, and `False` otherwise

Checks whether all rows of `grid` should have the same height.

## getRowSpacing

gridLayoutGetRowSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> m Word32 | Returns: the spacing between consecutive rows

Retrieves the spacing set with `gridLayoutSetRowSpacing`.

## new

gridLayoutNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m GridLayout | Returns: the newly created `GtkGridLayout`

Creates a new `GtkGridLayout`.

## setBaselineRow

gridLayoutSetBaselineRow Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Int32 | `row`: the row index
-> m () |

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`.

## setColumnHomogeneous

gridLayoutSetColumnHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Bool | `homogeneous`: `True` to make columns homogeneous
-> m () |

Sets whether all columns of `grid` should have the same width.

## setColumnSpacing

gridLayoutSetColumnSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Word32 | `spacing`: the amount of space between columns, in pixels
-> m () |

Sets the amount of space to insert between consecutive columns.

## setRowBaselinePosition

gridLayoutSetRowBaselinePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Int32 | `row`: a row index
-> BaselinePosition | `pos`: a `GtkBaselinePosition`
-> m () |

Sets how the baseline should be positioned on `row` of the grid, in case that row is assigned more space than is requested.

## setRowHomogeneous

gridLayoutSetRowHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Bool | `homogeneous`: `True` to make rows homogeneous
-> m () |

Sets whether all rows of `grid` should have the same height.

## setRowSpacing

gridLayoutSetRowSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsGridLayout a) |
=> a | `grid`: a `GtkGridLayout`
-> Word32 | `spacing`: the amount of space between rows, in pixels
-> m () |

Sets the amount of space to insert between consecutive rows.

# Properties

## baselineRow

The row to align to the baseline, when `GtkWidget:valign` is set to `AlignBaseline`.

constructGridLayoutBaselineRow :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`baseline-row`” property. This is rarely needed directly, but it is used by `new`.

getGridLayoutBaselineRow :: (MonadIO m, IsGridLayout o) => o -> m Int32 Source #

Get the value of the “`baseline-row`” property. When overloading is enabled, this is equivalent to

    get gridLayout #baselineRow

setGridLayoutBaselineRow :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m () Source #

Set the value of the “`baseline-row`” property. When overloading is enabled, this is equivalent to

    set gridLayout [ #baselineRow := value ]

## columnHomogeneous

Whether all the columns in the grid have the same width.

constructGridLayoutColumnHomogeneous :: (IsGridLayout o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`column-homogeneous`” property. This is rarely needed directly, but it is used by `new`.

getGridLayoutColumnHomogeneous :: (MonadIO m, IsGridLayout o) => o -> m Bool Source #

Get the value of the “`column-homogeneous`” property. When overloading is enabled, this is equivalent to

    get gridLayout #columnHomogeneous

setGridLayoutColumnHomogeneous :: (MonadIO m, IsGridLayout o) => o -> Bool -> m () Source #

Set the value of the “`column-homogeneous`” property. When overloading is enabled, this is equivalent to

    set gridLayout [ #columnHomogeneous := value ]

## columnSpacing

The amount of space between to consecutive columns.

constructGridLayoutColumnSpacing :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`column-spacing`” property. This is rarely needed directly, but it is used by `new`.

getGridLayoutColumnSpacing :: (MonadIO m, IsGridLayout o) => o -> m Int32 Source #

Get the value of the “`column-spacing`” property. When overloading is enabled, this is equivalent to

    get gridLayout #columnSpacing

setGridLayoutColumnSpacing :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m () Source #

Set the value of the “`column-spacing`” property. When overloading is enabled, this is equivalent to

    set gridLayout [ #columnSpacing := value ]

## rowHomogeneous

Whether all the rows in the grid have the same height.

constructGridLayoutRowHomogeneous :: (IsGridLayout o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`row-homogeneous`” property. This is rarely needed directly, but it is used by `new`.

getGridLayoutRowHomogeneous :: (MonadIO m, IsGridLayout o) => o -> m Bool Source #

Get the value of the “`row-homogeneous`” property. When overloading is enabled, this is equivalent to

    get gridLayout #rowHomogeneous

setGridLayoutRowHomogeneous :: (MonadIO m, IsGridLayout o) => o -> Bool -> m () Source #

Set the value of the “`row-homogeneous`” property. When overloading is enabled, this is equivalent to

    set gridLayout [ #rowHomogeneous := value ]

## rowSpacing

The amount of space between to consecutive rows.

constructGridLayoutRowSpacing :: (IsGridLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`row-spacing`” property. This is rarely needed directly, but it is used by `new`.

getGridLayoutRowSpacing :: (MonadIO m, IsGridLayout o) => o -> m Int32 Source #

Get the value of the “`row-spacing`” property. When overloading is enabled, this is equivalent to

    get gridLayout #rowSpacing

setGridLayoutRowSpacing :: (MonadIO m, IsGridLayout o) => o -> Int32 -> m () Source #

Set the value of the “`row-spacing`” property. When overloading is enabled, this is equivalent to

    set gridLayout [ #rowSpacing := value ]