11.112Class GtkTable

Pack widgets in regular patterns

Class GtkTable( [rows],[columns],[homogeneous] )
rows The number of rows the new table should have (default 0).
columns The number of columns the new table should have (default 0).
homogeneous (default false) If set to true, all table cells are resized to the size of the cell containing the largest widget.

The GtkTable 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.

Widgets can be added to a table using attach() or the more convenient (but slightly less flexible) attach_defaults().

To alter the space next to a specific row, use set_row_spacing(), and for a column, set_col_spacing().

The gaps between all rows or columns can be changed by calling set_row_spacings() or set_col_spacings() respectively.

set_homogeneous(), can be used to set whether all cells in the table will resize themselves to the size of the largest widget in the table.

Methods
attachAdds a widget to a table.
attach_defaultsAdds a widget to a table.
get_col_spacingGets the amount of space between column col, and column col + 1.
get_default_col_spacingGets the default column spacing for the table.
get_default_row_spacingGets the default row spacing for the table. This is the spacing that will be used for newly added rows.
get_homogeneousReturns whether the table cells are all constrained to the same width and height.
get_row_spacingGets the amount of space between row row, and row row + 1.
resizeResizes the table.
set_col_spacingAlters the amount of space between a given table column and the following column.
set_col_spacingsSets the space between every column in table equal to spacing.
set_homogeneousChanges the homogenous property of table cells, ie. whether all cells are an equal size or not.
set_row_spacingChanges the space between a given table row and the subsequent row.
set_row_spacingsSets the space between every row in table equal to spacing.

Methods

attach

Adds a widget to a table.

GtkTable.attach( child, left_attach, right_attach, top_attach, bottom_attach, xoptions, yoptions, xpadding, ypadding )
child The widget to add.
left_attach the column number to attach the left side of a child widget to.
right_attach the column number to attach the right side of a child widget to.
top_attach the row number to attach the top of a child widget to.
bottom_attach the row number to attach the bottom of a child widget to.
xoptions (GtkAttachOptions) Used to specify the properties of the child widget when the table is resized.
yoptions (GtkAttachOptions) The same as xoptions, except this field determines behaviour of vertical resizing.
xpadding An integer value specifying the padding on the left and right of the widget being added to the table.
ypadding The amount of padding above and below the child widget.

The number of 'cells' that a widget will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lowest column and row numbers of the table. (Columns and rows are indexed from zero).

attach_defaults

Adds a widget to a table.

GtkTable.attach_defaults( child, left_attach, right_attach, top_attach, bottom_attach )
child The widget to add.
left_attach the column number to attach the left side of a child widget to.
right_attach the column number to attach the right side of a child widget to.
top_attach the row number to attach the top of a child widget to.
bottom_attach the row number to attach the bottom of a child widget to.

As there are many options associated with attach(), 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 GtkAttachOptions are GTK_EXPAND | GTK_FILL, and the padding is set to 0.

get_col_spacing

Gets the amount of space between column col, and column col + 1.

GtkTable.get_col_spacing( column )
column a column in the table, 0 indicates the first column
Returnthe column spacing

get_default_col_spacing

Gets the default column spacing for the table.

GtkTable.get_default_col_spacing()
Returnthe default column spacing

This is the spacing that will be used for newly added columns.

get_default_row_spacing

Gets the default row spacing for the table. This is the spacing that will be used for newly added rows.

GtkTable.get_default_row_spacing()
Returnthe default row spacing

get_homogeneous

Returns whether the table cells are all constrained to the same width and height.

GtkTable.get_homogeneous()
Return(boolean) true if the cells are all constrained to the same size

get_row_spacing

Gets the amount of space between row row, and row row + 1.

GtkTable.get_row_spacing( row )
row a row in the table, 0 indicates the first row
Returnthe row spacing

resize

Resizes the table.

GtkTable.resize( rows, columns )
rows The new number of rows.
columns The new number of columns.

If you need to change a table's size after it has been created, this function allows you to do so.

set_col_spacing

Alters the amount of space between a given table column and the following column.

GtkTable.set_col_spacing( column, spacing )
column the column whose spacing should be changed.
spacing number of pixels that the spacing should take up.

set_col_spacings

Sets the space between every column in table equal to spacing.

GtkTable.set_col_spacings( spacing )
spacing the number of pixels of space to place between every column in the table.

set_homogeneous

Changes the homogenous property of table cells, ie. whether all cells are an equal size or not.

GtkTable.set_homogeneous( homogeneous )
homogeneous Set to true to ensure all table cells are the same size. Set to false if this is not your desired behaviour.

set_row_spacing

Changes the space between a given table row and the subsequent row.

GtkTable.set_row_spacing( row, spacing )
row row number whose spacing will be changed.
spacing number of pixels that the spacing should take up.

set_row_spacings

Sets the space between every row in table equal to spacing.

GtkTable.set_row_spacings( spacing )
spacing the number of pixels of space to place between every row in the table.
Made with http://www.falconpl.org