Gtk.Grid
const Gtk = imports.gi.Gtk; let grid = new Gtk.Grid({ column_homogeneous: value, column_spacing: value, row_homogeneous: value, row_spacing: value, });
GtkGrid is a container which arranges its child widgets in rows and columns. It is a very similar to Gtk.Table and Gtk.Box, but it consistently uses Gtk.Widget's Gtk.margin and Gtk.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.attach. They can span multiple rows or columns. It is also possible to add a child next to an existing child, using Gtk.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 by just using Gtk.Container.prototype.add, which will place children next to each other in the direction determined by the Gtk.orientation property.
Hierarchy
-
GObject.Object
-
GObject.InitiallyUnowned
-
Gtk.Widget
-
Gtk.Container
- Gtk.Grid
-
-
-
Methods
- Gtk.Grid.prototype.attach
- Gtk.Grid.prototype.attach_next_to
- Gtk.Grid.prototype.get_child_at
- Gtk.Grid.prototype.get_column_homogeneous
- Gtk.Grid.prototype.get_column_spacing
- Gtk.Grid.prototype.get_row_homogeneous
- Gtk.Grid.prototype.get_row_spacing
- Gtk.Grid.prototype.insert_column
- Gtk.Grid.prototype.insert_next_to
- Gtk.Grid.prototype.insert_row
- Gtk.Grid.prototype.set_column_homogeneous
- Gtk.Grid.prototype.set_column_spacing
- Gtk.Grid.prototype.set_row_homogeneous
- Gtk.Grid.prototype.set_row_spacing