Gtk.Table

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Table
Parameters
Interf
Return Value

Attach

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

Parameters
Table
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.

Attach_Defaults

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

Parameters
Table
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.

Column_Spacing_Property

Column_Spacing_Property : constant Glib.Properties.Property_Uint;

Get_Col_Spacing

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

Parameters
Table
Column

a column in the table, 0 indicates the first column

Return Value

the column spacing

Get_Default_Col_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

Parameters
Table
Return Value

the default column spacing

Get_Default_Row_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

Parameters
Table
Return Value

the default row spacing

Get_Homogeneous

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

Parameters
Table
Return Value

True if the cells are all constrained to the same size

Get_Row_Spacing

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

Parameters
Table
Row

a row in the table, 0 indicates the first row

Return Value

the row spacing

Get_Size

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

Parameters
Table
Rows

return location for the number of rows, or null

Columns

return location for the number of columns, or null

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_New

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.

Parameters
Table
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.

Gtk_Table

type Gtk_Table is access all Gtk_Table_Record'Class;

Gtk_Table_New

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.

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

Return Value

Gtk_Table_Record

type Gtk_Table_Record is new Gtk_Container_Record with null record;

Homogeneous_Property

Homogeneous_Property : constant Glib.Properties.Property_Boolean;

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Table_Record, Gtk_Table);

Initialize

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.

Parameters
Table
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.

N_Columns_Property

N_Columns_Property : constant Glib.Properties.Property_Uint;

N_Rows_Property

N_Rows_Property : constant Glib.Properties.Property_Uint;

Resize

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

Parameters
Table
Rows

The new number of rows.

Columns

The new number of columns.

Row_Spacing_Property

Row_Spacing_Property : constant Glib.Properties.Property_Uint;

Set_Col_Spacing

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

Parameters
Table
Column

the column whose spacing should be changed.

Spacing

number of pixels that the spacing should take up.

Set_Col_Spacings

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

Parameters
Table
Spacing

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

Set_Homogeneous

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

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

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

Parameters
Table
Row

row number whose spacing will be changed.

Spacing

number of pixels that the spacing should take up.

Set_Row_Spacings

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

Parameters
Table
Spacing

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