Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
The table widget is a container in which widgets can be aligned in cells.
- 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
- 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
Types
class ContainerClass o => TableClass o Source
castToTable :: GObjectClass obj => obj -> Table Source
toTable :: TableClass o => o -> Table Source
Constructors
:: Int |
|
-> Int |
|
-> Bool |
|
-> 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
:: TableClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO () |
Change the dimensions of an already existing table.
data AttachOptions Source
Child widget attach options for table containers
Bounded AttachOptions | |
Enum AttachOptions | Mouse buttons. |
Eq AttachOptions | |
Show AttachOptions | |
Flags AttachOptions |
:: (TableClass self, WidgetClass child) | |
=> self | |
-> child |
|
-> Int |
|
-> Int |
|
-> Int |
|
-> Int |
|
-> [AttachOptions] |
|
-> [AttachOptions] |
|
-> Int |
|
-> Int |
|
-> 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).
:: (TableClass self, WidgetClass widget) | |
=> self | |
-> widget |
|
-> Int |
|
-> Int |
|
-> Int |
|
-> Int |
|
-> 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 [
, and the padding is set to 0.Expand
, Fill
]
:: TableClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO () |
Changes the space between a given table row and its surrounding rows.
:: TableClass self | |
=> self | |
-> Int |
|
-> IO Int | returns the row spacing |
Gets the amount of space between row row
, and row row
+ 1. See
tableSetRowSpacing
.
:: TableClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO () |
Alters the amount of space between a given table column and the adjacent columns.
:: TableClass self | |
=> self | |
-> Int |
|
-> IO Int | returns the column spacing |
Gets the amount of space between column col
, and column col
+ 1. See
tableSetColSpacing
.
:: TableClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the space between every row in table
equal to spacing
.
tableGetDefaultRowSpacing Source
:: 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
)
:: TableClass self | |
=> self | |
-> Int |
|
-> IO () |
Sets the space between every column in table
equal to spacing
.
tableGetDefaultColSpacing Source
:: 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
)
:: TableClass self | |
=> self | |
-> Bool |
|
-> IO () |
Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.
:: TableClass self | |
=> self | |
-> IO Bool | returns |
Returns whether the table cells are all constrained to the same width and
height. (See tableSetHomogeneous
)
:: 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
tableChildYOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions] Source
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