Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- attach
- attachNextTo
- getBaselineRow
- getChildAt
- getColumnHomogeneous
- getColumnSpacing
- getRowBaselinePosition
- getRowHomogeneous
- getRowSpacing
- insertColumn
- insertNextTo
- insertRow
- new
- removeColumn
- removeRow
- setBaselineRow
- setColumnHomogeneous
- setColumnSpacing
- setRowBaselinePosition
- setRowHomogeneous
- setRowSpacing
- Properties
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.
- newtype Grid = Grid (ManagedPtr Grid)
- class GObject o => IsGrid o
- toGrid :: IsGrid o => o -> IO Grid
- noGrid :: Maybe Grid
- data GridAttachMethodInfo
- gridAttach :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a -> b -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- data GridAttachNextToMethodInfo
- gridAttachNextTo :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b, IsWidget c) => a -> b -> Maybe c -> PositionType -> Int32 -> Int32 -> m ()
- data GridGetBaselineRowMethodInfo
- gridGetBaselineRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Int32
- data GridGetChildAtMethodInfo
- gridGetChildAt :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> Int32 -> m (Maybe Widget)
- data GridGetColumnHomogeneousMethodInfo
- gridGetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Bool
- data GridGetColumnSpacingMethodInfo
- gridGetColumnSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Word32
- data GridGetRowBaselinePositionMethodInfo
- gridGetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m BaselinePosition
- data GridGetRowHomogeneousMethodInfo
- gridGetRowHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Bool
- data GridGetRowSpacingMethodInfo
- gridGetRowSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> m Word32
- data GridInsertColumnMethodInfo
- gridInsertColumn :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- data GridInsertNextToMethodInfo
- gridInsertNextTo :: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) => a -> b -> PositionType -> m ()
- data GridInsertRowMethodInfo
- gridInsertRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- gridNew :: (HasCallStack, MonadIO m) => m Grid
- data GridRemoveColumnMethodInfo
- gridRemoveColumn :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- data GridRemoveRowMethodInfo
- gridRemoveRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- data GridSetBaselineRowMethodInfo
- gridSetBaselineRow :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> m ()
- data GridSetColumnHomogeneousMethodInfo
- gridSetColumnHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> Bool -> m ()
- data GridSetColumnSpacingMethodInfo
- gridSetColumnSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> Word32 -> m ()
- data GridSetRowBaselinePositionMethodInfo
- gridSetRowBaselinePosition :: (HasCallStack, MonadIO m, IsGrid a) => a -> Int32 -> BaselinePosition -> m ()
- data GridSetRowHomogeneousMethodInfo
- gridSetRowHomogeneous :: (HasCallStack, MonadIO m, IsGrid a) => a -> Bool -> m ()
- data GridSetRowSpacingMethodInfo
- gridSetRowSpacing :: (HasCallStack, MonadIO m, IsGrid a) => a -> Word32 -> m ()
- data GridBaselineRowPropertyInfo
- constructGridBaselineRow :: IsGrid o => Int32 -> IO (GValueConstruct o)
- getGridBaselineRow :: (MonadIO m, IsGrid o) => o -> m Int32
- gridBaselineRow :: AttrLabelProxy "baselineRow"
- setGridBaselineRow :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
- data GridColumnHomogeneousPropertyInfo
- constructGridColumnHomogeneous :: IsGrid o => Bool -> IO (GValueConstruct o)
- getGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool
- gridColumnHomogeneous :: AttrLabelProxy "columnHomogeneous"
- setGridColumnHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m ()
- data GridColumnSpacingPropertyInfo
- constructGridColumnSpacing :: IsGrid o => Int32 -> IO (GValueConstruct o)
- getGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> m Int32
- gridColumnSpacing :: AttrLabelProxy "columnSpacing"
- setGridColumnSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
- data GridRowHomogeneousPropertyInfo
- constructGridRowHomogeneous :: IsGrid o => Bool -> IO (GValueConstruct o)
- getGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> m Bool
- gridRowHomogeneous :: AttrLabelProxy "rowHomogeneous"
- setGridRowHomogeneous :: (MonadIO m, IsGrid o) => o -> Bool -> m ()
- data GridRowSpacingPropertyInfo
- constructGridRowSpacing :: IsGrid o => Int32 -> IO (GValueConstruct o)
- getGridRowSpacing :: (MonadIO m, IsGrid o) => o -> m Int32
- gridRowSpacing :: AttrLabelProxy "rowSpacing"
- setGridRowSpacing :: (MonadIO m, IsGrid o) => o -> Int32 -> m ()
Exported types
GObject Grid Source # | |
IsImplementorIface Grid Source # | |
IsObject Grid Source # | |
IsWidget Grid Source # | |
IsContainer Grid Source # | |
IsOrientable Grid Source # | |
IsBuildable Grid Source # | |
IsGrid Grid Source # | |
((~) * info (ResolveGridMethod t Grid), MethodInfo * info Grid p) => IsLabel t (Grid -> p) Source # | |
((~) * info (ResolveGridMethod t Grid), MethodInfo * info Grid p) => IsLabelProxy t (Grid -> p) Source # | |
HasAttributeList * Grid Source # | |
type AttributeList Grid Source # | |
type SignalList Grid Source # | |
Methods
attach
data GridAttachMethodInfo Source #
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> 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
data GridAttachNextToMethodInfo Source #
((~) * signature (b -> Maybe c -> PositionType -> Int32 -> Int32 -> m ()), MonadIO m, IsGrid a, IsWidget b, IsWidget c) => MethodInfo * GridAttachNextToMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b, IsWidget c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> PositionType |
|
-> Int32 |
|
-> Int32 |
|
-> 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
data GridGetBaselineRowMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsGrid a) => MethodInfo * GridGetBaselineRowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Int32 | Returns: the row index defining the global baseline |
Returns which row defines the global baseline of grid
.
Since: 3.10
getChildAt
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m (Maybe Widget) | Returns: the child at the given position, or |
Gets the child of grid
whose area covers the grid
cell whose upper left corner is at left
, top
.
Since: 3.2
getColumnHomogeneous
data GridGetColumnHomogeneousMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsGrid a) => MethodInfo * GridGetColumnHomogeneousMethodInfo a signature Source # | |
gridGetColumnHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Bool | Returns: whether all columns of |
Returns whether all columns of grid
have the same width.
getColumnSpacing
data GridGetColumnSpacingMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsGrid a) => MethodInfo * GridGetColumnSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Word32 | Returns: the column spacing of |
Returns the amount of space between the columns of grid
.
getRowBaselinePosition
data GridGetRowBaselinePositionMethodInfo Source #
((~) * signature (Int32 -> m BaselinePosition), MonadIO m, IsGrid a) => MethodInfo * GridGetRowBaselinePositionMethodInfo a signature Source # | |
gridGetRowBaselinePosition Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> m BaselinePosition | Returns: the baseline position of |
Returns the baseline position of row
as set
by gridSetRowBaselinePosition
or the default value
BaselinePositionCenter
.
Since: 3.10
getRowHomogeneous
data GridGetRowHomogeneousMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsGrid a) => MethodInfo * GridGetRowHomogeneousMethodInfo a signature Source # | |
gridGetRowHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Bool | Returns: whether all rows of |
Returns whether all rows of grid
have the same height.
getRowSpacing
data GridGetRowSpacingMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsGrid a) => MethodInfo * GridGetRowSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> m Word32 | Returns: the row spacing of |
Returns the amount of space between the rows of grid
.
insertColumn
data GridInsertColumnMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridInsertColumnMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
data GridInsertNextToMethodInfo Source #
((~) * signature (b -> PositionType -> m ()), MonadIO m, IsGrid a, IsWidget b) => MethodInfo * GridInsertNextToMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a, IsWidget b) | |
=> a |
|
-> b |
|
-> PositionType |
|
-> 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
data GridInsertRowMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridInsertRowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m) | |
=> m Grid | Returns: the new |
Creates a new grid widget.
removeColumn
data GridRemoveColumnMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridRemoveColumnMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
data GridRemoveRowMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridRemoveRowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
data GridSetBaselineRowMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetBaselineRowMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
data GridSetColumnHomogeneousMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetColumnHomogeneousMethodInfo a signature Source # | |
gridSetColumnHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether all columns of grid
will have the same width.
setColumnSpacing
data GridSetColumnSpacingMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetColumnSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the amount of space between columns of grid
.
setRowBaselinePosition
data GridSetRowBaselinePositionMethodInfo Source #
((~) * signature (Int32 -> BaselinePosition -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetRowBaselinePositionMethodInfo a signature Source # | |
gridSetRowBaselinePosition Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Int32 |
|
-> 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
data GridSetRowHomogeneousMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetRowHomogeneousMethodInfo a signature Source # | |
gridSetRowHomogeneous Source #
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether all rows of grid
will have the same height.
setRowSpacing
data GridSetRowSpacingMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsGrid a) => MethodInfo * GridSetRowSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsGrid a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the amount of space between rows of grid
.
Properties
baselineRow
data GridBaselineRowPropertyInfo Source #
constructGridBaselineRow :: IsGrid o => Int32 -> IO (GValueConstruct o) Source #
gridBaselineRow :: AttrLabelProxy "baselineRow" Source #
columnHomogeneous
data GridColumnHomogeneousPropertyInfo Source #
constructGridColumnHomogeneous :: IsGrid o => Bool -> IO (GValueConstruct o) Source #
gridColumnHomogeneous :: AttrLabelProxy "columnHomogeneous" Source #
columnSpacing
data GridColumnSpacingPropertyInfo Source #
constructGridColumnSpacing :: IsGrid o => Int32 -> IO (GValueConstruct o) Source #
gridColumnSpacing :: AttrLabelProxy "columnSpacing" Source #
rowHomogeneous
data GridRowHomogeneousPropertyInfo Source #
constructGridRowHomogeneous :: IsGrid o => Bool -> IO (GValueConstruct o) Source #
gridRowHomogeneous :: AttrLabelProxy "rowHomogeneous" Source #
rowSpacing
data GridRowSpacingPropertyInfo Source #
constructGridRowSpacing :: IsGrid o => Int32 -> IO (GValueConstruct o) Source #
gridRowSpacing :: AttrLabelProxy "rowSpacing" Source #