gtk3-0.15.10: 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.Table

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Child Attributes

Description

The table widget is a container in which widgets can be aligned in cells.

Synopsis

- data Table
- class ContainerClass o => TableClass o
- castToTable :: GObjectClass obj => obj -> Table
- gTypeTable :: GType
- toTable :: TableClass o => o -> Table
- tableNew :: Int -> Int -> Bool -> IO Table
- tableResize :: TableClass self => self -> Int -> Int -> IO ()
- data AttachOptions
  - = Expand
  - | Shrink
  - | Fill
- tableAttach :: (TableClass self, WidgetClass child) => self -> child -> Int -> Int -> Int -> Int -> [AttachOptions] -> [AttachOptions] -> Int -> Int -> IO ()
- tableAttachDefaults :: (TableClass self, WidgetClass widget) => self -> widget -> Int -> Int -> Int -> Int -> IO ()
- tableSetRowSpacing :: TableClass self => self -> Int -> Int -> IO ()
- tableGetRowSpacing :: TableClass self => self -> Int -> IO Int
- tableSetColSpacing :: TableClass self => self -> Int -> Int -> IO ()
- tableGetColSpacing :: TableClass self => self -> Int -> IO Int
- tableSetRowSpacings :: TableClass self => self -> Int -> IO ()
- tableGetDefaultRowSpacing :: TableClass self => self -> IO Int
- tableSetColSpacings :: TableClass self => self -> Int -> IO ()
- tableGetDefaultColSpacing :: TableClass self => self -> IO Int
- tableSetHomogeneous :: TableClass self => self -> Bool -> IO ()
- tableGetHomogeneous :: TableClass self => self -> IO Bool
- tableGetSize :: TableClass self => self -> IO (Int, Int)
- tableNRows :: TableClass self => Attr self Int
- tableNColumns :: TableClass self => Attr self Int
- tableRowSpacing :: TableClass self => Attr self Int
- tableColumnSpacing :: TableClass self => Attr self Int
- tableHomogeneous :: TableClass self => Attr self Bool
- tableChildLeftAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int
- tableChildRightAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int
- tableChildTopAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int
- tableChildBottomAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int
- tableChildXOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions]
- tableChildYOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions]
- tableChildXPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int
- tableChildYPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int

# Detail

The `Table` functions allow the programmer to arrange widgets in rows and columns, making it easy to align many widgets next to each other, horizontally and vertically.

Tables are created with a call to `tableNew`, the size of which can later be changed with `tableResize`.

Widgets can be added to a table using `tableAttach` or the more convenient (but slightly less flexible) `tableAttachDefaults`.

To alter the space next to a specific row, use `tableSetRowSpacing`, and for a column, `tableSetColSpacing`.

The gaps between all rows or columns can be changed by calling `tableSetRowSpacings` or `tableSetColSpacings` respectively.

`tableSetHomogeneous`, can be used to set whether all cells in the table will resize themselves to the size of the largest widget in the table.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Table

# Types

data Table Source #

#### Instances

Instances details

Eq Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: Table -> Table -> Bool Source # (/=) :: Table -> Table -> Bool Source #
Ord Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: Table -> Table -> Ordering Source # (<) :: Table -> Table -> Bool Source # (<=) :: Table -> Table -> Bool Source # (>) :: Table -> Table -> Bool Source # (>=) :: Table -> Table -> Bool Source # max :: Table -> Table -> Table Source # min :: Table -> Table -> Table Source #
GObjectClass Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: Table -> GObject Source # unsafeCastGObject :: GObject -> Table Source #
ContainerClass Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types
TableClass Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ContainerClass o => TableClass o Source #

#### Instances

Instances details

TableClass Table Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToTable :: GObjectClass obj => obj -> Table Source #

gTypeTable :: GType Source #

toTable :: TableClass o => o -> Table Source #

# Constructors

tableNew Source #

Arguments

:: Int | `rows` - The number of rows the new table should have.
-> Int | `columns` - The number of columns the new table should have.
-> Bool | `homogeneous` - If set to `True`, all table cells are resized to the size of the cell containing the largest widget.
-> IO Table |

Used to create a new table widget. An initial size must be given by specifying how many rows and columns the table should have, although this can be changed later with `tableResize`. `rows` and `columns` must both be in the range 0 .. 65535.

# Methods

tableResize Source #

Arguments

:: TableClass self |
=> self |
-> Int | `rows` - The new number of rows.
-> Int | `columns` - The new number of columns.
-> IO () |

Change the dimensions of an already existing table.

data AttachOptions Source #

Child widget attach options for table containers

Constructors

Expand |
Shrink |
Fill |

#### Instances

Instances details

Bounded AttachOptions Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods minBound :: AttachOptions Source # maxBound :: AttachOptions Source #
Enum AttachOptions Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: AttachOptions -> AttachOptions Source #

pred :: AttachOptions -> AttachOptions Source #

toEnum :: Int -> AttachOptions Source #

fromEnum :: AttachOptions -> Int Source #

enumFrom :: AttachOptions -> [AttachOptions] Source #

enumFromThen :: AttachOptions -> AttachOptions -> [AttachOptions] Source #

enumFromTo :: AttachOptions -> AttachOptions -> [AttachOptions] Source #

enumFromThenTo :: AttachOptions -> AttachOptions -> AttachOptions -> [AttachOptions] Source #

Show AttachOptions Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> AttachOptions -> ShowS Source # show :: AttachOptions -> String Source # showList :: [AttachOptions] -> ShowS Source #
Eq AttachOptions Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: AttachOptions -> AttachOptions -> Bool Source # (/=) :: AttachOptions -> AttachOptions -> Bool Source #
Flags AttachOptions Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums

tableAttach Source #

Arguments

:: (TableClass self, WidgetClass child) |
=> self |
-> child | `child` - The widget to add.
-> Int | `leftAttach` - the column number to attach the left side of a child widget to.
-> Int | `rightAttach` - the column number to attach the right side of a child widget to.
-> Int | `topAttach` - the row number to attach the top of a child widget to.
-> Int | `bottomAttach` - the row number to attach the bottom of a child widget to.
-> [AttachOptions] | `xoptions` - Used to specify the properties of the child widget when the table is resized.
-> [AttachOptions] | `yoptions` - The same as xoptions, except this field determines behaviour of vertical resizing.
-> Int | `xpadding` - An integer value specifying the padding on the left and right of the widget being added to the table.
-> Int | `ypadding` - The amount of padding above and below the child widget.
-> IO () |

Adds a widget to a table. The number of 'cells' that a widget will occupy is specified by `leftAttach`, `rightAttach`, `topAttach` and `bottomAttach`. These each represent the leftmost, rightmost, uppermost and lowest column and row numbers of the table. (Columns and rows are indexed from zero).

tableAttachDefaults Source #

Arguments

:: (TableClass self, WidgetClass widget) |
=> self |
-> widget | `widget` - The child widget to add.
-> Int | `leftAttach` - The column number to attach the left side of the child widget to.
-> Int | `rightAttach` - The column number to attach the right side of the child widget to.
-> Int | `topAttach` - The row number to attach the top of the child widget to.
-> Int | `bottomAttach` - The row number to attach the bottom of the child widget to.
-> IO () |

As there are many options associated with `tableAttach`, this convenience function provides the programmer with a means to add children to a table with identical padding and expansion options. The values used for the `AttachOptions` are `[`Expand`, `Fill`]`, and the padding is set to 0.

tableSetRowSpacing Source #

Arguments

:: TableClass self |
=> self |
-> Int | `row` - row number whose spacing will be changed.
-> Int | `spacing` - number of pixels that the spacing should take up.
-> IO () |

Changes the space between a given table row and its surrounding rows.

tableGetRowSpacing Source #

Arguments

:: TableClass self |
=> self |
-> Int | `row` - a row in the table, 0 indicates the first row
-> IO Int | returns the row spacing

Gets the amount of space between row `row`, and row `row` + 1. See `tableSetRowSpacing`.

tableSetColSpacing Source #

Arguments

:: TableClass self |
=> self |
-> Int | `column` - the column whose spacing should be changed.
-> Int | `spacing` - number of pixels that the spacing should take up.
-> IO () |

Alters the amount of space between a given table column and the adjacent columns.

tableGetColSpacing Source #

Arguments

:: TableClass self |
=> self |
-> Int | `column` - a column in the table, 0 indicates the first column
-> IO Int | returns the column spacing

Gets the amount of space between column `col`, and column `col` + 1. See `tableSetColSpacing`.

tableSetRowSpacings Source #

Arguments

:: TableClass self |
=> self |
-> Int | `spacing` - the number of pixels of space to place between every row in the table.
-> IO () |

Sets the space between every row in `table` equal to `spacing`.

tableGetDefaultRowSpacing Source #

Arguments

:: TableClass self |
=> self |
-> IO Int | returns the default row spacing

Gets the default row spacing for the table. This is the spacing that will be used for newly added rows. (See `tableSetRowSpacings`)

tableSetColSpacings Source #

Arguments

:: TableClass self |
=> self |
-> Int | `spacing` - the number of pixels of space to place between every column in the table.
-> IO () |

Sets the space between every column in `table` equal to `spacing`.

tableGetDefaultColSpacing Source #

Arguments

:: TableClass self |
=> self |
-> IO Int | returns the default column spacing

Gets the default column spacing for the table. This is the spacing that will be used for newly added columns. (See `tableSetColSpacings`)

tableSetHomogeneous Source #

Arguments

:: TableClass self |
=> self |
-> Bool | `homogeneous` - Set to `True` to ensure all table cells are the same size. Set to `False` if this is not your desired behaviour.
-> IO () |

Changes the homogeneous property of table cells, ie. whether all cells are an equal size or not.

tableGetHomogeneous Source #

Arguments

:: TableClass self |
=> self |
-> IO Bool | returns `True` if the cells are all constrained to the same size

Returns whether the table cells are all constrained to the same width and height. (See `tableSetHomogeneous`)

tableGetSize Source #

Arguments

:: TableClass self |
=> self |
-> IO (Int, Int) | returns (rows, columns) of table

Returns the size of `Table`.

- Available since Gtk+ version 2.22

# Attributes

tableNRows :: TableClass self => Attr self Int Source #

The number of rows in the table.

Default value: 0

tableNColumns :: TableClass self => Attr self Int Source #

The number of columns in the table.

Default value: 0

tableRowSpacing :: TableClass self => Attr self Int Source #

The amount of space between two consecutive rows.

Default value: 0

tableColumnSpacing :: TableClass self => Attr self Int Source #

The amount of space between two consecutive columns.

Default value: 0

tableHomogeneous :: TableClass self => Attr self Bool Source #

If `True` this means the table cells are all the same width/height.

Default value: `False`

# Child Attributes

tableChildLeftAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

The column number to attach the left side of the child to.

Allowed values: <= 65535

Default value: 0

tableChildRightAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

The column number to attach the right side of a child widget to.

Allowed values: [1,65535]

Default value: 1

tableChildTopAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

The row number to attach the top of a child widget to.

Allowed values: <= 65535

Default value: 0

tableChildBottomAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

The row number to attach the bottom of the child to.

Allowed values: [1,65535]

Default value: 1

tableChildXOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions] Source #

Options specifying the horizontal behaviour of the child.

Default value: `[`Expand`, `Fill`]`

tableChildYOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions] Source #

Options specifying the vertical behaviour of the child.

Default value: `[`Expand`, `Fill`]`

tableChildXPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

Extra space to put between the child and its left and right neighbors, in pixels.

Allowed values: <= 65535

Default value: 0

tableChildYPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int Source #

Extra space to put between the child and its upper and lower neighbors, in pixels.

Allowed values: <= 65535

Default value: 0