Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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. Note that spacing is added between the
children, while padding added by tableAttach
is added on
either side of the widget it belongs to.
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.
'GI.Gtk.Objects.Table.Table' has been deprecated. Use 'GI.Gtk.Objects.Grid.Grid' instead. It provides the same capabilities as GtkTable for arranging widgets in a rectangular grid, but does support height-for-width geometry management.
- newtype Table = Table (ManagedPtr Table)
- class GObject o => IsTable o
- toTable :: IsTable o => o -> IO Table
- noTable :: Maybe Table
- data TableAttachMethodInfo
- tableAttach :: (HasCallStack, MonadIO m, IsTable a, IsWidget b) => a -> b -> Word32 -> Word32 -> Word32 -> Word32 -> [AttachOptions] -> [AttachOptions] -> Word32 -> Word32 -> m ()
- data TableAttachDefaultsMethodInfo
- tableAttachDefaults :: (HasCallStack, MonadIO m, IsTable a, IsWidget b) => a -> b -> Word32 -> Word32 -> Word32 -> Word32 -> m ()
- data TableGetColSpacingMethodInfo
- tableGetColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m Word32
- data TableGetDefaultColSpacingMethodInfo
- tableGetDefaultColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> m Word32
- data TableGetDefaultRowSpacingMethodInfo
- tableGetDefaultRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> m Word32
- data TableGetHomogeneousMethodInfo
- tableGetHomogeneous :: (HasCallStack, MonadIO m, IsTable a) => a -> m Bool
- data TableGetRowSpacingMethodInfo
- tableGetRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m Word32
- data TableGetSizeMethodInfo
- tableGetSize :: (HasCallStack, MonadIO m, IsTable a) => a -> m (Word32, Word32)
- tableNew :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Bool -> m Table
- data TableResizeMethodInfo
- tableResize :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- data TableSetColSpacingMethodInfo
- tableSetColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- data TableSetColSpacingsMethodInfo
- tableSetColSpacings :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m ()
- data TableSetHomogeneousMethodInfo
- tableSetHomogeneous :: (HasCallStack, MonadIO m, IsTable a) => a -> Bool -> m ()
- data TableSetRowSpacingMethodInfo
- tableSetRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- data TableSetRowSpacingsMethodInfo
- tableSetRowSpacings :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m ()
- data TableColumnSpacingPropertyInfo
- constructTableColumnSpacing :: IsTable o => Word32 -> IO (GValueConstruct o)
- getTableColumnSpacing :: (MonadIO m, IsTable o) => o -> m Word32
- setTableColumnSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- tableColumnSpacing :: AttrLabelProxy "columnSpacing"
- data TableHomogeneousPropertyInfo
- constructTableHomogeneous :: IsTable o => Bool -> IO (GValueConstruct o)
- getTableHomogeneous :: (MonadIO m, IsTable o) => o -> m Bool
- setTableHomogeneous :: (MonadIO m, IsTable o) => o -> Bool -> m ()
- tableHomogeneous :: AttrLabelProxy "homogeneous"
- data TableNColumnsPropertyInfo
- constructTableNColumns :: IsTable o => Word32 -> IO (GValueConstruct o)
- getTableNColumns :: (MonadIO m, IsTable o) => o -> m Word32
- setTableNColumns :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- tableNColumns :: AttrLabelProxy "nColumns"
- data TableNRowsPropertyInfo
- constructTableNRows :: IsTable o => Word32 -> IO (GValueConstruct o)
- getTableNRows :: (MonadIO m, IsTable o) => o -> m Word32
- setTableNRows :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- tableNRows :: AttrLabelProxy "nRows"
- data TableRowSpacingPropertyInfo
- constructTableRowSpacing :: IsTable o => Word32 -> IO (GValueConstruct o)
- getTableRowSpacing :: (MonadIO m, IsTable o) => o -> m Word32
- setTableRowSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- tableRowSpacing :: AttrLabelProxy "rowSpacing"
Exported types
GObject Table Source # | |
IsImplementorIface Table Source # | |
IsObject Table Source # | |
IsWidget Table Source # | |
IsContainer Table Source # | |
IsBuildable Table Source # | |
IsTable Table Source # | |
((~) * info (ResolveTableMethod t Table), MethodInfo * info Table p) => IsLabel t (Table -> p) Source # | |
((~) * info (ResolveTableMethod t Table), MethodInfo * info Table p) => IsLabelProxy t (Table -> p) Source # | |
HasAttributeList * Table Source # | |
type AttributeList Table Source # | |
type SignalList Table Source # | |
Methods
attach
data TableAttachMethodInfo Source #
((~) * signature (b -> Word32 -> Word32 -> Word32 -> Word32 -> [AttachOptions] -> [AttachOptions] -> Word32 -> Word32 -> m ()), MonadIO m, IsTable a, IsWidget b) => MethodInfo * TableAttachMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a, IsWidget b) | |
=> a |
|
-> b |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> [AttachOptions] |
|
-> [AttachOptions] |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use gridAttach
with Grid
. Note that the attach arguments differ between those two functions.
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).
To make a button occupy the lower right cell of a 2x2 table, use > >gtk_table_attach (table, button, > 1, 2, // left, right attach > 1, 2, // top, bottom attach > xoptions, yoptions, > xpadding, ypadding);
If you want to make the button span the entire bottom row, use leftAttach
== 0 and rightAttach
= 2 instead.
attachDefaults
:: (HasCallStack, MonadIO m, IsTable a, IsWidget b) | |
=> a |
|
-> b |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use gridAttach
with Grid
. Note that the attach arguments differ between those two functions.
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 GTK_EXPAND | GTK_FILL
, and the padding is set to 0.
getColSpacing
data TableGetColSpacingMethodInfo Source #
((~) * signature (Word32 -> m Word32), MonadIO m, IsTable a) => MethodInfo * TableGetColSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m Word32 | Returns: the column spacing |
Deprecated: (Since version 3.4)Grid
does not offer a replacement for this functionality.
Gets the amount of space between column col
, and
column col
+ 1. See tableSetColSpacing
.
getDefaultColSpacing
data TableGetDefaultColSpacingMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsTable a) => MethodInfo * TableGetDefaultColSpacingMethodInfo a signature Source # | |
tableGetDefaultColSpacing Source #
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> m Word32 | Returns: the default column spacing |
Deprecated: (Since version 3.4)Use gridGetColumnSpacing
with Grid
.
Gets the default column spacing for the table. This is
the spacing that will be used for newly added columns.
(See tableSetColSpacings
)
getDefaultRowSpacing
data TableGetDefaultRowSpacingMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsTable a) => MethodInfo * TableGetDefaultRowSpacingMethodInfo a signature Source # | |
tableGetDefaultRowSpacing Source #
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> m Word32 | Returns: the default row spacing |
Deprecated: (Since version 3.4)Use gridGetRowSpacing
with Grid
.
Gets the default row spacing for the table. This is
the spacing that will be used for newly added rows.
(See tableSetRowSpacings
)
getHomogeneous
data TableGetHomogeneousMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsTable a) => MethodInfo * TableGetHomogeneousMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.4)Use gridGetRowHomogeneous
and gridGetColumnHomogeneous
with Grid
.
Returns whether the table cells are all constrained to the same width and height. (See gtk_table_set_homogeneous ())
getRowSpacing
data TableGetRowSpacingMethodInfo Source #
((~) * signature (Word32 -> m Word32), MonadIO m, IsTable a) => MethodInfo * TableGetRowSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m Word32 | Returns: the row spacing |
Deprecated: (Since version 3.4)Grid
does not offer a replacement for this functionality.
Gets the amount of space between row row
, and
row row
+ 1. See tableSetRowSpacing
.
getSize
data TableGetSizeMethodInfo Source #
((~) * signature (m (Word32, Word32)), MonadIO m, IsTable a) => MethodInfo * TableGetSizeMethodInfo a signature Source # | |
Deprecated: (Since version 3.4)Grid
does not expose the number of columns and rows.
Gets the number of rows and columns in the table.
Since: 2.22
new
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> Bool |
|
-> m Table | Returns: A pointer to the newly created table widget. |
Deprecated: (Since version 3.4)Use gridNew
.
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 1 .. 65535. For historical reasons, 0 is accepted
as well and is silently interpreted as 1.
resize
data TableResizeMethodInfo Source #
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableResizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Grid
resizes automatically.
If you need to change a table’s size after it has been created, this function allows you to do so.
setColSpacing
data TableSetColSpacingMethodInfo Source #
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetColSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use widgetSetMarginStart
and widgetSetMarginEnd
on the widgets contained in the row if you need this functionality. Grid
does not support per-row spacing.
Alters the amount of space between a given table column and the following column.
setColSpacings
data TableSetColSpacingsMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetColSpacingsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use gridSetColumnSpacing
with Grid
.
Sets the space between every column in table
equal to spacing
.
setHomogeneous
data TableSetHomogeneousMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetHomogeneousMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.4)Use gridSetRowHomogeneous
and gridSetColumnHomogeneous
with Grid
.
Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.
setRowSpacing
data TableSetRowSpacingMethodInfo Source #
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetRowSpacingMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use widgetSetMarginTop
and widgetSetMarginBottom
on the widgets contained in the row if you need this functionality. Grid
does not support per-row spacing.
Changes the space between a given table row and the subsequent row.
setRowSpacings
data TableSetRowSpacingsMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetRowSpacingsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)Use gridSetRowSpacing
with Grid
.
Sets the space between every row in table
equal to spacing
.
Properties
columnSpacing
data TableColumnSpacingPropertyInfo Source #
constructTableColumnSpacing :: IsTable o => Word32 -> IO (GValueConstruct o) Source #
tableColumnSpacing :: AttrLabelProxy "columnSpacing" Source #
homogeneous
data TableHomogeneousPropertyInfo Source #
constructTableHomogeneous :: IsTable o => Bool -> IO (GValueConstruct o) Source #
tableHomogeneous :: AttrLabelProxy "homogeneous" Source #
nColumns
data TableNColumnsPropertyInfo Source #
constructTableNColumns :: IsTable o => Word32 -> IO (GValueConstruct o) Source #
tableNColumns :: AttrLabelProxy "nColumns" Source #
nRows
data TableNRowsPropertyInfo Source #
constructTableNRows :: IsTable o => Word32 -> IO (GValueConstruct o) Source #
tableNRows :: AttrLabelProxy "nRows" Source #
rowSpacing
data TableRowSpacingPropertyInfo Source #
constructTableRowSpacing :: IsTable o => Word32 -> IO (GValueConstruct o) Source #
tableRowSpacing :: AttrLabelProxy "rowSpacing" Source #