package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Table_Record, Gtk_Table);
type Gtk_Table_Record is new Gtk_Container_Record with null record;
type Gtk_Table is access all Gtk_Table_Record'Class;
Column_Spacing_Property : constant Glib.Properties.Property_Uint;
Homogeneous_Property : constant Glib.Properties.Property_Boolean;
N_Columns_Property : constant Glib.Properties.Property_Uint;
N_Rows_Property : constant Glib.Properties.Property_Uint;
Row_Spacing_Property : constant Glib.Properties.Property_Uint;
procedure Initialize
( | Table | : not null access Gtk_Table_Record'Class; |
Rows | : Guint; | |
Columns | : Guint; | |
Homogeneous | : Boolean); |
function Get_Type return Glib.GType;
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); |
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); |
function Get_Col_Spacing
( | Table | : not null access Gtk_Table_Record; |
Column | : Guint) return Guint; |
procedure Set_Col_Spacing
( | Table | : not null access Gtk_Table_Record; |
Column | : Guint; | |
Spacing | : Guint); |
function Get_Default_Col_Spacing
( | Table | : not null access Gtk_Table_Record) return Guint; |
function Get_Default_Row_Spacing
( | Table | : not null access Gtk_Table_Record) return Guint; |
function Get_Homogeneous
( | Table | : not null access Gtk_Table_Record) return Boolean; |
procedure Set_Homogeneous
( | Table | : not null access Gtk_Table_Record; |
Homogeneous | : Boolean); |
function Get_Row_Spacing
( | Table | : not null access Gtk_Table_Record; |
Row | : Guint) return Guint; |
procedure Set_Row_Spacing
( | Table | : not null access Gtk_Table_Record; |
Row | : Guint; | |
Spacing | : Guint); |
procedure Get_Size
( | Table | : not null access Gtk_Table_Record; |
Rows | : out Guint; | |
Columns | : out Guint); |
procedure Resize
( | Table | : not null access Gtk_Table_Record; |
Rows | : Guint; | |
Columns | : Guint); |
procedure Set_Col_Spacings
( | Table | : not null access Gtk_Table_Record; |
Spacing | : Guint); |
procedure Set_Row_Spacings
( | Table | : not null access Gtk_Table_Record; |
Spacing | : Guint); |
function "+"
( | Widget | : access Gtk_Table_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Table renames Implements_Gtk_Buildable.To_Object; |
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.
Note: 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.