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

Maintainergtk2hs-users@lists.sourceforge.net
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Layout.Table

Contents

Description

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

Synopsis

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

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 

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 homogenous 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