Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
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.
t'GI.Gtk.Objects.Table.Table' has been deprecated. Use t'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.
Synopsis
- newtype Table = Table (ManagedPtr Table)
- class (GObject o, IsDescendantOf Table o) => IsTable o
- toTable :: (MonadIO m, IsTable o) => o -> m Table
- tableAttach :: (HasCallStack, MonadIO m, IsTable a, IsWidget b) => a -> b -> Word32 -> Word32 -> Word32 -> Word32 -> [AttachOptions] -> [AttachOptions] -> Word32 -> Word32 -> m ()
- tableAttachDefaults :: (HasCallStack, MonadIO m, IsTable a, IsWidget b) => a -> b -> Word32 -> Word32 -> Word32 -> Word32 -> m ()
- tableGetColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m Word32
- tableGetDefaultColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> m Word32
- tableGetDefaultRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> m Word32
- tableGetHomogeneous :: (HasCallStack, MonadIO m, IsTable a) => a -> m Bool
- tableGetRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m Word32
- tableGetSize :: (HasCallStack, MonadIO m, IsTable a) => a -> m (Word32, Word32)
- tableNew :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Bool -> m Table
- tableResize :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- tableSetColSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- tableSetColSpacings :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m ()
- tableSetHomogeneous :: (HasCallStack, MonadIO m, IsTable a) => a -> Bool -> m ()
- tableSetRowSpacing :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> Word32 -> m ()
- tableSetRowSpacings :: (HasCallStack, MonadIO m, IsTable a) => a -> Word32 -> m ()
- constructTableColumnSpacing :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getTableColumnSpacing :: (MonadIO m, IsTable o) => o -> m Word32
- setTableColumnSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- constructTableHomogeneous :: (IsTable o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTableHomogeneous :: (MonadIO m, IsTable o) => o -> m Bool
- setTableHomogeneous :: (MonadIO m, IsTable o) => o -> Bool -> m ()
- constructTableNColumns :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getTableNColumns :: (MonadIO m, IsTable o) => o -> m Word32
- setTableNColumns :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- constructTableNRows :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getTableNRows :: (MonadIO m, IsTable o) => o -> m Word32
- setTableNRows :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
- constructTableRowSpacing :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getTableRowSpacing :: (MonadIO m, IsTable o) => o -> m Word32
- setTableRowSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Table Source # | |
IsGValue Table Source # | Convert |
ManagedPtrNewtype Table Source # | |
Defined in GI.Gtk.Objects.Table toManagedPtr :: Table -> ManagedPtr Table # | |
TypedObject Table Source # | |
Defined in GI.Gtk.Objects.Table | |
GObject Table Source # | |
Defined in GI.Gtk.Objects.Table | |
HasParentTypes Table Source # | |
Defined in GI.Gtk.Objects.Table | |
type ParentTypes Table Source # | |
Defined in GI.Gtk.Objects.Table |
class (GObject o, IsDescendantOf Table o) => IsTable o Source #
Instances
(GObject o, IsDescendantOf Table o) => IsTable o Source # | |
Defined in GI.Gtk.Objects.Table |
Methods
Overloaded methods
attach
:: (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
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m Word32 | Returns: the column spacing |
Deprecated: (Since version 3.4)tGrid
does not offer a replacement for this functionality.
Gets the amount of space between column col
, and
column col
+ 1. See tableSetColSpacing
.
getDefaultColSpacing
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
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
:: (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
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> m Word32 | Returns: the row spacing |
Deprecated: (Since version 3.4)tGrid
does not offer a replacement for this functionality.
Gets the amount of space between row row
, and
row row
+ 1. See tableSetRowSpacing
.
getSize
Deprecated: (Since version 3.4)tGrid
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
:: (HasCallStack, MonadIO m, IsTable a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 3.4)tGrid
resizes automatically.
If you need to change a table’s size after it has been created, this function allows you to do so.
setColSpacing
:: (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
:: (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
:: (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
:: (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
:: (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
No description available in the introspection data.
constructTableColumnSpacing :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “column-spacing
” property. This is rarely needed directly, but it is used by new
.
getTableColumnSpacing :: (MonadIO m, IsTable o) => o -> m Word32 Source #
Get the value of the “column-spacing
” property.
When overloading is enabled, this is equivalent to
get
table #columnSpacing
setTableColumnSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #
Set the value of the “column-spacing
” property.
When overloading is enabled, this is equivalent to
set
table [ #columnSpacing:=
value ]
homogeneous
No description available in the introspection data.
constructTableHomogeneous :: (IsTable o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “homogeneous
” property. This is rarely needed directly, but it is used by new
.
getTableHomogeneous :: (MonadIO m, IsTable o) => o -> m Bool Source #
Get the value of the “homogeneous
” property.
When overloading is enabled, this is equivalent to
get
table #homogeneous
setTableHomogeneous :: (MonadIO m, IsTable o) => o -> Bool -> m () Source #
Set the value of the “homogeneous
” property.
When overloading is enabled, this is equivalent to
set
table [ #homogeneous:=
value ]
nColumns
No description available in the introspection data.
constructTableNColumns :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “n-columns
” property. This is rarely needed directly, but it is used by new
.
getTableNColumns :: (MonadIO m, IsTable o) => o -> m Word32 Source #
Get the value of the “n-columns
” property.
When overloading is enabled, this is equivalent to
get
table #nColumns
setTableNColumns :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #
Set the value of the “n-columns
” property.
When overloading is enabled, this is equivalent to
set
table [ #nColumns:=
value ]
nRows
No description available in the introspection data.
constructTableNRows :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “n-rows
” property. This is rarely needed directly, but it is used by new
.
getTableNRows :: (MonadIO m, IsTable o) => o -> m Word32 Source #
Get the value of the “n-rows
” property.
When overloading is enabled, this is equivalent to
get
table #nRows
setTableNRows :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #
Set the value of the “n-rows
” property.
When overloading is enabled, this is equivalent to
set
table [ #nRows:=
value ]
rowSpacing
No description available in the introspection data.
constructTableRowSpacing :: (IsTable o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “row-spacing
” property. This is rarely needed directly, but it is used by new
.
getTableRowSpacing :: (MonadIO m, IsTable o) => o -> m Word32 Source #
Get the value of the “row-spacing
” property.
When overloading is enabled, this is equivalent to
get
table #rowSpacing
setTableRowSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #
Set the value of the “row-spacing
” property.
When overloading is enabled, this is equivalent to
set
table [ #rowSpacing:=
value ]