The Gtk.Table.Gtk_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 Gtk.Table.Gtk_New, the size of which can later be changed with Gtk.Table.Resize.
Widgets can be added to a table using Gtk.Table.Attach or the more convenient (but slightly less flexible) Gtk.Table.Attach_Defaults.
To alter the space next to a specific row, use Gtk.Table.Set_Row_Spacing, and for a column, Gtk.Table.Set_Col_Spacing. The gaps between all rows or columns can be changed by calling Gtk.Table.Set_Row_Spacings or Gtk.Table.Set_Col_Spacings respectively. Note that spacing is added between the children, while padding added by Gtk.Table.Attach is added on either side of the widget it belongs to.
Gtk.Table.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.
> Gtk.Table.Gtk_Table has been deprecated. Use Gtk.Grid.Gtk_Grid instead. It provides the same > capabilities as GtkTable for arranging widgets in a rectangular grid, but > does support height-for-width geometry management.
<group>Layout containers</group>
function "+"
(Widget : access Gtk_Table_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Table
procedure Attach
(Table : not null access Gtk_Table_Record;
Child : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Left_Attach : Guint;
Right_Attach : Guint;
Top_Attach : Guint;
Bottom_Attach : Guint;
Xoptions : Gtk.Enums.Gtk_Attach_Options := Expand or Fill;
Yoptions : Gtk.Enums.Gtk_Attach_Options := Expand or Fill;
Xpadding : Guint := 0;
Ypadding : Guint := 0)
Insert a new widget in the table. All the attachments are relative to the separations between columns and rows (for instance, to insert a widget spanning the first two columns in the table, you should put Left_Attach=0 and Right_Attach=2). Same behavior for the rows. Xoptions and Yoptions indicate the behavior of the child when the table is resized (whether the child can shrink or expand). See the description in Gtk.Box for more information on the possible values. Xpadding and Ypadding are the amount of space left around the child. Deprecated since 3.4, 1
The widget to add.
the column number to attach the left side of a child widget to.
the column number to attach the right side of a child widget to.
the row number to attach the top of a child widget to.
the row number to attach the bottom of a child widget to.
Used to specify the properties of the child widget when the table is resized.
The same as xoptions, except this field determines behaviour of vertical resizing.
An integer value specifying the padding on the left and right of the widget being added to the table.
The amount of padding above and below the child widget.
procedure Attach_Defaults
(Table : not null access Gtk_Table_Record;
Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Left_Attach : Guint;
Right_Attach : Guint;
Top_Attach : Guint;
Bottom_Attach : Guint)
Insert a new widget in the table, with default values. No padding is put around the child, and the options are set to Expand and Fill. This call is similar to Attach with default values and is only provided for compatibility. Deprecated since 3.4, 1
The child widget to add.
The column number to attach the left side of the child widget to.
The column number to attach the right side of the child widget to.
The row number to attach the top of the child widget to.
The row number to attach the bottom of the child widget to.
Column_Spacing_Property : constant Glib.Properties.Property_Uint;
function Get_Col_Spacing
(Table : not null access Gtk_Table_Record;
Column : Guint) return Guint
Gets the amount of space between column Col, and column Col + 1. See Gtk.Table.Set_Col_Spacing. Deprecated since 3.4, 1
a column in the table, 0 indicates the first column
the column spacing
function Get_Default_Col_Spacing
(Table : not null access Gtk_Table_Record) return Guint
Gets the default column spacing for the table. This is the spacing that will be used for newly added columns. (See Gtk.Table.Set_Col_Spacings) Deprecated since 3.4, 1
the default column spacing
function Get_Default_Row_Spacing
(Table : not null access Gtk_Table_Record) return Guint
Gets the default row spacing for the table. This is the spacing that will be used for newly added rows. (See Gtk.Table.Set_Row_Spacings) Deprecated since 3.4, 1
the default row spacing
function Get_Homogeneous
(Table : not null access Gtk_Table_Record) return Boolean
Returns whether the table cells are all constrained to the same width and height. (See gtk_table_set_homogeneous ()) Deprecated since 3.4, 1
True if the cells are all constrained to the same size
function Get_Row_Spacing
(Table : not null access Gtk_Table_Record;
Row : Guint) return Guint
Gets the amount of space between row Row, and row Row + 1. See Gtk.Table.Set_Row_Spacing. Deprecated since 3.4, 1
a row in the table, 0 indicates the first row
the row spacing
procedure Get_Size
(Table : not null access Gtk_Table_Record;
Rows : out Guint;
Columns : out Guint)
Gets the number of rows and columns in the table. Since: gtk+ 2.22 Deprecated since 3.4, 1
return location for the number of rows, or null
return location for the number of columns, or null
function Get_Type return Glib.GType
procedure Gtk_New
(Table : out Gtk_Table;
Rows : Guint;
Columns : Guint;
Homogeneous : Boolean)
Create a new table. The width allocated to the table is divided into Columns columns, which all have the same width if Homogeneous is True. If Homogeneous is False, the width will be calculated with the children contained in the table. Same behavior for the rows. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The number of rows the new table should have.
The number of columns the new table should have.
If set to True, all table cells are resized to the size of the cell containing the largest widget.
type Gtk_Table is access all Gtk_Table_Record'Class;
function Gtk_Table_New
(Rows : Guint;
Columns : Guint;
Homogeneous : Boolean) return Gtk_Table
Create a new table. The width allocated to the table is divided into Columns columns, which all have the same width if Homogeneous is True. If Homogeneous is False, the width will be calculated with the children contained in the table. Same behavior for the rows.
The number of rows the new table should have.
The number of columns the new table should have.
If set to True, all table cells are resized to the size of the cell containing the largest widget.
type Gtk_Table_Record is new Gtk_Container_Record with null record;
Homogeneous_Property : constant Glib.Properties.Property_Boolean;
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Table_Record, Gtk_Table);
procedure Initialize
(Table : not null access Gtk_Table_Record'Class;
Rows : Guint;
Columns : Guint;
Homogeneous : Boolean)
Create a new table. The width allocated to the table is divided into Columns columns, which all have the same width if Homogeneous is True. If Homogeneous is False, the width will be calculated with the children contained in the table. Same behavior for the rows. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The number of rows the new table should have.
The number of columns the new table should have.
If set to True, all table cells are resized to the size of the cell containing the largest widget.
N_Columns_Property : constant Glib.Properties.Property_Uint;
N_Rows_Property : constant Glib.Properties.Property_Uint;
procedure Resize
(Table : not null access Gtk_Table_Record;
Rows : Guint;
Columns : Guint)
If you need to change a table's size after it has been created, this function allows you to do so. Deprecated since 3.4, 1
The new number of rows.
The new number of columns.
Row_Spacing_Property : constant Glib.Properties.Property_Uint;
procedure Set_Col_Spacing
(Table : not null access Gtk_Table_Record;
Column : Guint;
Spacing : Guint)
Set the spacing in pixels between Column and the next one. Deprecated since 3.4, 1
the column whose spacing should be changed.
number of pixels that the spacing should take up.
procedure Set_Col_Spacings
(Table : not null access Gtk_Table_Record;
Spacing : Guint)
Sets the space between every column in Table equal to Spacing. Deprecated since 3.4, 1
the number of pixels of space to place between every column in the table.
procedure Set_Homogeneous
(Table : not null access Gtk_Table_Record;
Homogeneous : Boolean)
Indicate the homogeneous status of the table. If Homogeneous is True, the rows and columns of the table will all be allocated the same width or height. Deprecated since 3.4, 1
Set to True to ensure all table cells are the same size. Set to False if this is not your desired behaviour.
procedure Set_Row_Spacing
(Table : not null access Gtk_Table_Record;
Row : Guint;
Spacing : Guint)
Changes the space between a given table row and the subsequent row. Deprecated since 3.4, 1
row number whose spacing will be changed.
number of pixels that the spacing should take up.
procedure Set_Row_Spacings
(Table : not null access Gtk_Table_Record;
Spacing : Guint)
Sets the space between every row in Table equal to Spacing. Deprecated since 3.4, 1
the number of pixels of space to place between every row in the table.