gtk3-0.14.1: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Layout.Grid

Contents

- Detail
- Types
- Constructors
- Methods

Description

A widget which controls the alignment and size of its child

Synopsis

- data Grid
- class ContainerClass o => GridClass o
- castToGrid :: GObjectClass obj => obj -> Grid
- gTypeGrid :: GType
- toGrid :: GridClass o => o -> Grid
- gridNew :: IO Grid
- gridAttach :: (GridClass self, WidgetClass child) => self -> child -> Int -> Int -> Int -> Int -> IO ()
- gridAttachNextTo :: (GridClass self, WidgetClass child, WidgetClass sibling) => self -> child -> Maybe sibling -> PositionType -> Int -> Int -> IO ()
- gridSetRowHomogeneous :: GridClass self => self -> Bool -> IO ()
- gridGetRowHomogeneous :: GridClass self => self -> IO Bool
- gridSetRowSpacing :: GridClass self => self -> Int -> IO ()
- gridGetRowSpacing :: GridClass self => self -> IO Int
- gridSetColumnHomogeneous :: GridClass self => self -> Bool -> IO ()
- gridGetColumnHomogeneous :: GridClass self => self -> IO Bool
- gridSetColumnSpacing :: GridClass self => self -> Int -> IO ()
- gridGetColumnSpacing :: GridClass self => self -> IO Int
- gridGetChildAt :: GridClass self => self -> Int -> Int -> IO (Maybe Widget)
- gridInsertRow :: GridClass self => self -> Int -> IO ()
- gridInsertColumn :: GridClass self => self -> Int -> IO ()
- gridInsertNextTo :: (GridClass self, WidgetClass sibling) => self -> sibling -> PositionType -> IO ()
- gridRemoveRow :: GridClass self => self -> Int -> IO ()
- gridRemoveColumn :: GridClass self => self -> Int -> IO ()
- gridGetBaselineRow :: GridClass self => self -> IO Int
- gridSetBaselineRow :: GridClass self => self -> Int -> IO ()
- gridGetRowBaselinePosition :: GridClass self => self -> Int -> IO BaselinePosition
- gridSetRowBaselinePosition :: GridClass self => self -> Int -> BaselinePosition -> IO ()

# Detail

`Grid` packs widgets into rows and columns.

- Class Hierarchy | `| `GObject` | +----`Object` | +----`Widget` | +----`Container` | +----Grid`

# Types

data Grid

Instances

Eq Grid |
Ord Grid |
GObjectClass Grid |
GridClass Grid |
ContainerClass Grid |
WidgetClass Grid |

class ContainerClass o => GridClass o

Instances

GridClass Grid |

castToGrid :: GObjectClass obj => obj -> Grid

gTypeGrid :: GType

toGrid :: GridClass o => o -> Grid

# Constructors

gridNew :: IO Grid

Creates a new grid widget.

# Methods

gridAttach

Arguments

:: (GridClass self, WidgetClass child) |
=> self | `self` - the grid.
-> child | `child` - the widget to add.
-> Int | `left` - the column number of to attach the left side of child to.
-> Int | `top` - the row number to attach the top side of child to.
-> Int | `width` - the number of columns that child will span.
-> Int | `height` - the number of rows that child will span.
-> IO () |

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.

gridAttachNextTo

Arguments

:: (GridClass self, WidgetClass child, WidgetClass sibling) |
=> self | `self` - the grid.
-> child | `child` - the widget to add
-> Maybe sibling | `sib` - the child of grid that child will be placed next to.
-> PositionType | `pos` - the side of the sibling that child is positioned next to.
-> Int | `width` - the number of columns that child will span.
-> Int | `height` - the number of rows that child will span.
-> IO () |

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 == GTK_POS_LEFT yields a layout of 3[1].

gridSetRowHomogeneous

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Bool | `homogeneous` - True to make row homogeneous.
-> IO () |

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

gridGetRowHomogeneous

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> IO Bool | returns whether all rows of grid have same height.

Returns whether all rows of grid have the same height.

gridSetRowSpacing

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `spacing` - the amount of space to insert between rows.
-> IO () |

Sets the amount of space between rows of grid.

gridGetRowSpacing

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> IO Int | returns the spacing of grid.

Returns the amount of space between the rows of grid.

gridSetColumnHomogeneous

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Bool | `homogeneous` - True to make columns homogeneous.
-> IO () |

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

gridGetColumnHomogeneous

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> IO Bool | returns whether all columns of grid have the same width.

Returns whether all columns of grid have the same width.

gridSetColumnSpacing

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `spacing` - the amount of space to insert between columns.
-> IO () |

Sets the amount of space between columns of grid.

gridGetColumnSpacing

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> IO Int | returns the spacing of grid.

Returns the amount of space between the columns of grid.

gridGetChildAt

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `left` - the left edge of the cell.
-> Int | `top` - the top edge of the cell.
-> IO (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 .

gridInsertRow

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `pos` - the position to insert the row at.
-> IO () |

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.

gridInsertColumn

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `pos` - the positiion to insert the column at.
-> IO () |

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

gridInsertNextTo

Arguments

:: (GridClass self, WidgetClass sibling) |
=> self | `self` - the grid.
-> sibling | `sib` - the child of grid that the new row or column will be placed next to.
-> PositionType | `pos` - the isde of the sibling that child is positioned next to.
-> IO () |

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 GTK_POS_TOP or GTK_POS_BOTTOM, a row is inserted. If side is GTK_POS_LEFT of GTK_POS_RIGHT, a column is inserted.

gridRemoveRow

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `pos` - the position of the row to remove.
-> IO () |

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.

gridRemoveColumn

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `pos` -the position of the column to remove.
-> IO () |

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.

gridGetBaselineRow

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> IO Int | returns the row index defining the global baseline.

Returns which row defines the global baseline of grid.

gridSetBaselineRow

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `row` - the row index.
-> IO () |

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.

gridGetRowBaselinePosition

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `row` - a row index.
-> IO BaselinePosition | returns the baseline position of row.

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

gridSetRowBaselinePosition

Arguments

:: GridClass self |
=> self | `self` - the grid.
-> Int | `row` - a row index.
-> BaselinePosition | `pos` - a BaselinePosition.
-> IO () |

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