gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Table

Contents

Description

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.

Synopsis

Exported types

newtype Table Source #

Constructors

Table (ManagedPtr Table) 

Methods

attach

data TableAttachMethodInfo Source #

Instances

((~) * signature (b -> Word32 -> Word32 -> Word32 -> Word32 -> [AttachOptions] -> [AttachOptions] -> Word32 -> Word32 -> m ()), MonadIO m, IsTable a, IsWidget b) => MethodInfo * TableAttachMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy TableAttachMethodInfo a -> signature -> s #

tableAttach Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a, IsWidget b) 
=> a

table: The Table to add a new widget to.

-> b

child: The widget to add.

-> Word32

leftAttach: the column number to attach the left side of a child widget to.

-> Word32

rightAttach: the column number to attach the right side of a child widget to.

-> Word32

topAttach: the row number to attach the top of a child widget to.

-> Word32

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.

-> Word32

xpadding: An integer value specifying the padding on the left and right of the widget being added to the table.

-> Word32

ypadding: The amount of padding above and below the child widget.

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

data TableAttachDefaultsMethodInfo Source #

Instances

((~) * signature (b -> Word32 -> Word32 -> Word32 -> Word32 -> m ()), MonadIO m, IsTable a, IsWidget b) => MethodInfo * TableAttachDefaultsMethodInfo a signature Source # 

tableAttachDefaults Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a, IsWidget b) 
=> a

table: The table to add a new child widget to.

-> b

widget: The child widget to add.

-> Word32

leftAttach: The column number to attach the left side of the child widget to.

-> Word32

rightAttach: The column number to attach the right side of the child widget to.

-> Word32

topAttach: The row number to attach the top of the child widget to.

-> Word32

bottomAttach: The row number to attach the bottom of the child widget to.

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

tableGetColSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

-> Word32

column: a column in the table, 0 indicates the first column

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

tableGetDefaultColSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

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

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

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

tableGetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

-> m Bool

Returns: True if the cells are all constrained to the same size

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

tableGetRowSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

-> Word32

row: a row in the table, 0 indicates the first row

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

Instances

((~) * signature (m (Word32, Word32)), MonadIO m, IsTable a) => MethodInfo * TableGetSizeMethodInfo a signature Source # 

tableGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table

-> m (Word32, Word32) 

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

tableNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

rows: The number of rows the new table should have.

-> Word32

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.

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

Instances

((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableResizeMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy TableResizeMethodInfo a -> signature -> s #

tableResize Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: The Table you wish to change the size of.

-> Word32

rows: The new number of rows.

-> Word32

columns: The new number of columns.

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

Instances

((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetColSpacingMethodInfo a signature Source # 

tableSetColSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table.

-> Word32

column: the column whose spacing should be changed.

-> Word32

spacing: number of pixels that the spacing should take up.

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

tableSetColSpacings Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table.

-> Word32

spacing: the number of pixels of space to place between every column in the table.

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

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetHomogeneousMethodInfo a signature Source # 

tableSetHomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: The Table you wish to set the homogeneous properties of.

-> Bool

homogeneous: Set to True to ensure all table cells are the same size. Set to False if this is not your desired behaviour.

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

Instances

((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsTable a) => MethodInfo * TableSetRowSpacingMethodInfo a signature Source # 

tableSetRowSpacing Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table containing the row whose properties you wish to change.

-> Word32

row: row number whose spacing will be changed.

-> Word32

spacing: number of pixels that the spacing should take up.

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

tableSetRowSpacings Source #

Arguments

:: (HasCallStack, MonadIO m, IsTable a) 
=> a

table: a Table.

-> Word32

spacing: the number of pixels of space to place between every row in the table.

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

Instances

AttrInfo TableColumnSpacingPropertyInfo Source # 
type AttrOrigin TableColumnSpacingPropertyInfo Source # 
type AttrLabel TableColumnSpacingPropertyInfo Source # 
type AttrGetType TableColumnSpacingPropertyInfo Source # 
type AttrBaseTypeConstraint TableColumnSpacingPropertyInfo Source # 
type AttrSetTypeConstraint TableColumnSpacingPropertyInfo Source # 
type AttrAllowedOps TableColumnSpacingPropertyInfo Source # 

homogeneous

data TableHomogeneousPropertyInfo Source #

Instances

AttrInfo TableHomogeneousPropertyInfo Source # 
type AttrOrigin TableHomogeneousPropertyInfo Source # 
type AttrLabel TableHomogeneousPropertyInfo Source # 
type AttrGetType TableHomogeneousPropertyInfo Source # 
type AttrBaseTypeConstraint TableHomogeneousPropertyInfo Source # 
type AttrSetTypeConstraint TableHomogeneousPropertyInfo Source # 
type AttrAllowedOps TableHomogeneousPropertyInfo Source # 

setTableHomogeneous :: (MonadIO m, IsTable o) => o -> Bool -> m () Source #

nColumns

data TableNColumnsPropertyInfo Source #

Instances

AttrInfo TableNColumnsPropertyInfo Source # 
type AttrOrigin TableNColumnsPropertyInfo Source # 
type AttrLabel TableNColumnsPropertyInfo Source # 
type AttrGetType TableNColumnsPropertyInfo Source # 
type AttrBaseTypeConstraint TableNColumnsPropertyInfo Source # 
type AttrSetTypeConstraint TableNColumnsPropertyInfo Source # 
type AttrAllowedOps TableNColumnsPropertyInfo Source # 

setTableNColumns :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #

nRows

data TableNRowsPropertyInfo Source #

Instances

AttrInfo TableNRowsPropertyInfo Source # 
type AttrOrigin TableNRowsPropertyInfo Source # 
type AttrLabel TableNRowsPropertyInfo Source # 
type AttrGetType TableNRowsPropertyInfo Source # 
type AttrBaseTypeConstraint TableNRowsPropertyInfo Source # 
type AttrSetTypeConstraint TableNRowsPropertyInfo Source # 
type AttrAllowedOps TableNRowsPropertyInfo Source # 

setTableNRows :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #

rowSpacing

data TableRowSpacingPropertyInfo Source #

Instances

AttrInfo TableRowSpacingPropertyInfo Source # 
type AttrOrigin TableRowSpacingPropertyInfo Source # 
type AttrLabel TableRowSpacingPropertyInfo Source # 
type AttrGetType TableRowSpacingPropertyInfo Source # 
type AttrBaseTypeConstraint TableRowSpacingPropertyInfo Source # 
type AttrSetTypeConstraint TableRowSpacingPropertyInfo Source # 
type AttrAllowedOps TableRowSpacingPropertyInfo Source # 

setTableRowSpacing :: (MonadIO m, IsTable o) => o -> Word32 -> m () Source #