Graphics.UI.Gtk.Layout.Table

gtk-0.12.4: Binding to the Gtk+ graphical user interface library.

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

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

Instances

Eq Table |
Ord Table |
GObjectClass Table |
TableClass Table |
ContainerClass Table |
WidgetClass Table |
ObjectClass Table |

class ContainerClass o => TableClass o

Instances

TableClass Table |

castToTable :: GObjectClass obj => obj -> Table

gTypeTable :: GType

toTable :: TableClass o => o -> Table

# Constructors

tableNew

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

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

Child widget attach options for table containers

Constructors

Expand |
Shrink |
Fill |

Instances

Bounded AttachOptions |
Enum AttachOptions | Mouse buttons.
Eq AttachOptions |
Show AttachOptions |
Flags AttachOptions |

tableAttach

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

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

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

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

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

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

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

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

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

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

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 homogenous property of table cells, ie. whether all cells are an equal size or not.

tableGetHomogeneous

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

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

The number of rows in the table.

Default value: 0

tableNColumns :: TableClass self => Attr self Int

The number of columns in the table.

Default value: 0

tableRowSpacing :: TableClass self => Attr self Int

The amount of space between two consecutive rows.

Default value: 0

tableColumnSpacing :: TableClass self => Attr self Int

The amount of space between two consecutive columns.

Default value: 0

tableHomogeneous :: TableClass self => Attr self Bool

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

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

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

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

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]

Options specifying the horizontal behaviour of the child.

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

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

Options specifying the vertical behaviour of the child.

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

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

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

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

Allowed values: <= 65535

Default value: 0