package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Grid_Record, Gtk_Grid);
package Implements_Gtk_Orientable is new Glib.Types.Implements (Gtk.Orientable.Gtk_Orientable, Gtk_Grid_Record, Gtk_Grid);
type Gtk_Grid_Record is new Gtk_Container_Record with null record;
type Gtk_Grid is access all Gtk_Grid_Record'Class;
Column_Homogeneous_Property : constant Glib.Properties.Property_Boolean;
Column_Spacing_Property : constant Glib.Properties.Property_Int;
Row_Homogeneous_Property : constant Glib.Properties.Property_Boolean;
Row_Spacing_Property : constant Glib.Properties.Property_Int;
procedure Gtk_New
( | Self | : out Gtk_Grid); |
procedure Initialize
( | Self | : not null access Gtk_Grid_Record'Class); |
function Get_Type return Glib.GType;
procedure Attach
( | Self | : not null access Gtk_Grid_Record; |
Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Left | : Gint; | |
Top | : Gint; | |
Width | : Gint := 1; | |
Height | : Gint := 1); |
procedure Attach_Next_To
( | Self | : not null access Gtk_Grid_Record; |
Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Sibling | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Side | : Gtk.Enums.Gtk_Position_Type; | |
Width | : Gint := 1; | |
Height | : Gint := 1); |
function Get_Child_At
( | Self | : not null access Gtk_Grid_Record; |
Left | : Gint; | |
Top | : Gint) return Gtk.Widget.Gtk_Widget; |
function Get_Column_Homogeneous
( | Self | : not null access Gtk_Grid_Record) return Boolean; |
procedure Set_Column_Homogeneous
( | Self | : not null access Gtk_Grid_Record; |
Homogeneous | : Boolean); |
function Get_Column_Spacing
( | Self | : not null access Gtk_Grid_Record) return Guint; |
procedure Set_Column_Spacing
( | Self | : not null access Gtk_Grid_Record; |
Spacing | : Guint); |
function Get_Row_Homogeneous
( | Self | : not null access Gtk_Grid_Record) return Boolean; |
procedure Set_Row_Homogeneous
( | Self | : not null access Gtk_Grid_Record; |
Homogeneous | : Boolean); |
function Get_Row_Spacing
( | Self | : not null access Gtk_Grid_Record) return Guint; |
procedure Set_Row_Spacing
( | Self | : not null access Gtk_Grid_Record; |
Spacing | : Guint); |
procedure Insert_Column
( | Self | : not null access Gtk_Grid_Record; |
Position | : Gint); |
procedure Insert_Next_To
( | Self | : not null access Gtk_Grid_Record; |
Sibling | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
Side | : Gtk.Enums.Gtk_Position_Type); |
procedure Insert_Row
( | Self | : not null access Gtk_Grid_Record; |
Position | : Gint); |
function Get_Orientation
( | Self | : not null access Gtk_Grid_Record) return Gtk.Enums.Gtk_Orientation; |
procedure Set_Orientation
( | Self | : not null access Gtk_Grid_Record; |
Orientation | : Gtk.Enums.Gtk_Orientation); |
function "+"
( | Widget | : access Gtk_Grid_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Grid renames Implements_Gtk_Buildable.To_Object; |
function "+"
( | Widget | : access Gtk_Grid_Record'Class) return Gtk.Orientable.Gtk_Orientable renames Implements_Gtk_Orientable.To_Interface; |
function "-"
( | Interf | : Gtk.Orientable.Gtk_Orientable) return Gtk_Grid renames Implements_Gtk_Orientable.To_Object; |
GtkGrid is a container which arranges its child widgets in rows and columns. It is a very similar to Gtk.Table.Gtk_Table and Gtk.Box.Gtk_Box, but it consistently uses Gtk.Widget.Gtk_Widget's Gtk.Widget.Gtk_Widget:margin and Gtk.Widget.Gtk_Widget:expand properties instead of custom child properties, and it fully supports <link linkend="geometry-management">height-for-width geometry management</link>.
Children are added using Gtk.Grid.Attach. They can span multiple rows or columns. It is also possible to add a child next to an existing child, using Gtk.Grid.Attach_Next_To. The behaviour of GtkGrid when several children occupy the same grid cell is undefined.
GtkGrid can be used like a Gtk.Box.Gtk_Box by just using Gtk.Container.Add, which will place children next to each other in the direction determined by the Gtk.Orientable.Gtk_Orientable:orientation property.