gi-gtk-3.0.24: Gtk bindings

Copyright Will Thompson Iñaki García Etxebarria and Jonas Platte LGPL-2.1 Iñaki García Etxebarria (garetxe@gmail.com) None Haskell2010

GI.Gtk.Objects.Grid

Description

GtkGrid is a container which arranges its child widgets in rows and columns. It is a very similar to Table and Box, but it consistently uses Widget’s Widget:margin and Widget:expand properties instead of custom child properties, and it fully supports [height-for-width geometry management][geometry-management].

Children are added using gridAttach. They can span multiple rows or columns. It is also possible to add a child next to an existing child, using gridAttachNextTo. The behaviour of GtkGrid when several children occupy the same grid cell is undefined.

GtkGrid can be used like a Box by just using containerAdd, which will place children next to each other in the direction determined by the Orientable:orientation property.

# CSS nodes

GtkGrid uses a single CSS node with name grid.

Synopsis

# Exported types

newtype Grid Source #

Memory-managed wrapper type.

Constructors

 Grid (ManagedPtr Grid)
Instances
 Source # Instance detailsDefined in GI.Gtk.Objects.Grid Methods Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid

class GObject o => IsGrid o Source #

Type class for types which can be safely cast to Grid, for instance with toGrid.

Instances
 (GObject a, (UnknownAncestorError Grid a :: Constraint)) => IsGrid a Source # Instance detailsDefined in GI.Gtk.Objects.Grid Source # Instance detailsDefined in GI.Gtk.Objects.Grid

toGrid :: (MonadIO m, IsGrid o) => o -> m Grid Source #

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

A convenience alias for Nothing :: Maybe Grid.

# Methods

## attach

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a grid: a Grid -> b child: the widget to add -> Int32 left: the column number to attach the left side of child to -> Int32 top: the row number to attach the top side of child to -> Int32 width: the number of columns that child will span -> Int32 height: the number of rows that child will span -> m ()

Adds a widget to the grid.

The position of child is determined by left and top. The number of “cells” that child will occupy is determined by width and height.

## attachNextTo

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b, IsWidget c) => a grid: a Grid -> b child: the widget to add -> Maybe c sibling: the child of grid that child will be placed next to, or Nothing to place child at the beginning or end -> PositionType side: the side of sibling that child is positioned next to -> Int32 width: the number of columns that child will span -> Int32 height: the number of rows that child will span -> m ()

Adds a widget to the grid.

The widget is placed next to sibling, on the side determined by side. When sibling is Nothing, the widget is placed in row (for left or right placement) or column 0 (for top or bottom placement), at the end indicated by side.

Attaching widgets labeled [1], [2], [3] with sibling == Nothing and side == PositionTypeLeft yields a layout of [3][2][1].

## getBaselineRow

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> m Int32 Returns: the row index defining the global baseline

Returns which row defines the global baseline of grid.

Since: 3.10

## getChildAt

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 left: the left edge of the cell -> Int32 top: the top edge of the cell -> m (Maybe Widget) Returns: the child at the given position, or Nothing

Gets the child of grid whose area covers the grid cell whose upper left corner is at left, top.

Since: 3.2

## getColumnHomogeneous

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> m Bool Returns: whether all columns of grid have the same width.

Returns whether all columns of grid have the same width.

## getColumnSpacing

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> m Word32 Returns: the column spacing of grid

Returns the amount of space between the columns of grid.

## getRowBaselinePosition

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 row: a row index -> m BaselinePosition Returns: the baseline position of row

Returns the baseline position of row as set by gridSetRowBaselinePosition or the default value BaselinePositionCenter.

Since: 3.10

## getRowHomogeneous

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> m Bool Returns: whether all rows of grid have the same height.

Returns whether all rows of grid have the same height.

## getRowSpacing

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> m Word32 Returns: the row spacing of grid

Returns the amount of space between the rows of grid.

## insertColumn

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 position: the position to insert the column at -> m ()

Inserts a column at the specified position.

Children which are attached at or to the right of this position are moved one column to the right. Children which span across this position are grown to span the new column.

Since: 3.2

## insertNextTo

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a grid: a Grid -> b sibling: the child of grid that the new row or column will be placed next to -> PositionType side: the side of sibling that child is positioned next to -> m ()

Inserts a row or column at the specified position.

The new row or column is placed next to sibling, on the side determined by side. If side is PositionTypeTop or PositionTypeBottom, a row is inserted. If side is PositionTypeLeft of PositionTypeRight, a column is inserted.

Since: 3.2

## insertRow

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 position: the position to insert the row at -> m ()

Inserts a row at the specified position.

Children which are attached at or below this position are moved one row down. Children which span across this position are grown to span the new row.

Since: 3.2

## new

Arguments

 :: (HasCallStack, MonadIO m) => m Grid Returns: the new Grid

Creates a new grid widget.

## removeColumn

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 position: the position of the column to remove -> m ()

Removes a column from the grid.

Children that are placed in this column are removed, spanning children that overlap this column have their width reduced by one, and children after the column are moved to the left.

Since: 3.10

## removeRow

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 position: the position of the row to remove -> m ()

Removes a row from the grid.

Children that are placed in this row are removed, spanning children that overlap this row have their height reduced by one, and children below the row are moved up.

Since: 3.10

## setBaselineRow

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> 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.

Since: 3.10

## setColumnHomogeneous

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Bool homogeneous: True to make columns homogeneous -> m ()

Sets whether all columns of grid will have the same width.

## setColumnSpacing

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Word32 spacing: the amount of space to insert between columns -> m ()

Sets the amount of space between columns of grid.

## setRowBaselinePosition

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Int32 row: a row index -> BaselinePosition pos: a BaselinePosition -> m ()

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

Since: 3.10

## setRowHomogeneous

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Bool homogeneous: True to make rows homogeneous -> m ()

Sets whether all rows of grid will have the same height.

## setRowSpacing

Arguments

 :: (HasCallStack, MonadIO m, IsGrid a) => a grid: a Grid -> Word32 spacing: the amount of space to insert between rows -> m ()

Sets the amount of space between rows of grid.

# Properties

## baselineRow

No description available in the introspection data.

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

getGridBaselineRow :: (MonadIO m, IsGrid o) => o -> m Int32 Source #

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

get grid #baselineRow


setGridBaselineRow :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #

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

set grid [ #baselineRow := value ]


## columnHomogeneous

No description available in the introspection data.

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

getGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool Source #

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

get grid #columnHomogeneous


setGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m () Source #

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

set grid [ #columnHomogeneous := value ]


## columnSpacing

No description available in the introspection data.

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

getGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> m Int32 Source #

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

get grid #columnSpacing


setGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #

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

set grid [ #columnSpacing := value ]


## rowHomogeneous

No description available in the introspection data.

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

getGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool Source #

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

get grid #rowHomogeneous


setGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m () Source #

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

set grid [ #rowHomogeneous := value ]


## rowSpacing

No description available in the introspection data.

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

getGridRowSpacing :: (MonadIO m, IsGrid o) => o -> m Int32 Source #

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

get grid #rowSpacing


setGridRowSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m () Source #

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

set grid [ #rowSpacing := value ]