W Wrapl, The Programming Language

Libraries:Gtk:Gtk:Table

Types

T

Inherits from:

The T 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 gtk_table_new(), the size of which can later be changed with Resize.

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

To alter the space next to a specific row, use SetRowSpacing, and for a column, SetColSpacing.

The gaps between all rows or columns can be changed by calling SetRowSpacings or SetColSpacings respectively.

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



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New(rows @ Std.Integer.SmallT, columns @ Std.Integer.SmallT, homogeneous @ Std.Symbol.T) : Gtk.Gtk.Table.T

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

rows The number of rows the new table should have.
columns The number of columns the new table should have.
homogeneous If set to TRUE, all table cells are resized to the size of the cell containing the largest widget.
Returns A pointer to the the newly created table widget.


Methods

:Attach(self @ T, child @ Gtk.Gtk.Widget.T, left_attach @ Std.Integer.SmallT, right_attach @ Std.Integer.SmallT, top_attach @ Std.Integer.SmallT, bottom_attach @ Std.Integer.SmallT, xoptions @ Std.Integer.SmallT, yoptions @ Std.Integer.SmallT, xpadding @ Std.Integer.SmallT, ypadding @ Std.Integer.SmallT) : Std.Object.T

Adds a widget to a table. 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).

table The T to add a new widget to.
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 Used to specify the properties of the child widget when the table is resized.
yoptions 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.


:AttachDefaults(self @ T, widget @ Gtk.Gtk.Widget.T, left_attach @ Std.Integer.SmallT, right_attach @ Std.Integer.SmallT, top_attach @ Std.Integer.SmallT, bottom_attach @ Std.Integer.SmallT) : Std.Object.T

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 Gtk.Gtk.AttachOptions.T are GTK_EXPAND | GTK_FILL, and the padding is set to 0.

table The table to add a new child widget to.
widget The child widget to add.
left_attach The column number to attach the left side of the child widget to.
right_attach The column number to attach the right side of the child widget to.
top_attach The row number to attach the top of the child widget to.
bottom_attach The row number to attach the bottom of the child widget to.


:GetColSpacing(self @ T, column @ Std.Integer.SmallT) : Std.Integer.SmallT

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

table a T
column a column in the table, 0 indicates the first column
Returns the column spacing


:GetDefaultColSpacing(self @ T) : Std.Integer.SmallT

Gets the default column spacing for the table. This is the spacing that will be used for newly added columns. (See SetColSpacings)

table a T
Returns the default column spacing


:GetDefaultRowSpacing(self @ T) : Std.Integer.SmallT

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

table a T
Returns the default row spacing


:GetHomogeneous(self @ T) : Std.Symbol.T

Returns whether the table cells are all constrained to the same width and height. (See gtk_table_set_homogenous())

table a T
Returns TRUE if the cells are all constrained to the same size


:GetRowSpacing(self @ T, row @ Std.Integer.SmallT) : Std.Integer.SmallT

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

table a T
row a row in the table, 0 indicates the first row
Returns the row spacing


:GetSize(self @ T, rows @ Std.Object.T, columns @ Std.Object.T) : Std.Object.T

table a T
rows return location for the number of rows, or NULL. [out][allow-none]
columns return location for the number of columns, or NULL. [out][allow-none]


:Resize(self @ T, rows @ Std.Integer.SmallT, columns @ Std.Integer.SmallT) : Std.Object.T

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

table The T you wish to change the size of.
rows The new number of rows.
columns The new number of columns.


:SetColSpacing(self @ T, column @ Std.Integer.SmallT, spacing @ Std.Integer.SmallT) : Std.Object.T

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

table a T.
column the column whose spacing should be changed.
spacing number of pixels that the spacing should take up.


:SetColSpacings(self @ T, spacing @ Std.Integer.SmallT) : Std.Object.T

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

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


:SetHomogeneous(self @ T, homogeneous @ Std.Symbol.T) : Std.Object.T

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

table The T you wish to set the homogeneous properties of.
homogeneous Set to TRUE to ensure all table cells are the same size. Set to FALSE if this is not your desired behaviour.


:SetRowSpacing(self @ T, row @ Std.Integer.SmallT, spacing @ Std.Integer.SmallT) : Std.Object.T

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

table a T containing the row whose properties you wish to change.
row row number whose spacing will be changed.
spacing number of pixels that the spacing should take up.


:SetRowSpacings(self @ T, spacing @ Std.Integer.SmallT) : Std.Object.T

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

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