Box


Object Hierarchy:

Gtk.Box Gtk.Box Gtk.Box Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Box GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.Box Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Box Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.Box Gtk.ConstraintTarget->Gtk.Widget Gtk.Orientable Gtk.Orientable Gtk.Orientable->Gtk.Box

Description:

[ CCode ( type_id = "gtk_box_get_type ()" ) ]
public class Box : Widget, Accessible, Buildable, ConstraintTarget, Orientable

The `GtkBox` widget arranges child widgets into a single row or column.

![An example GtkBox](box.png)

Whether it is a row or column depends on the value of its [[email protected]:orientation] property. Within the other dimension, all children are allocated the same size. Of course, the [[email protected]:halign] and [[email protected]:valign] properties can be used on the children to influence their allocation.

Use repeated calls to [[email protected]] to pack widgets into a `GtkBox` from start to end. Use [[email protected]] to remove widgets from the `GtkBox`. [[email protected]_child_after] can be used to add a child at a particular position.

Use [[email protected]_homogeneous] to specify whether or not all children of the `GtkBox` are forced to get the same amount of space.

Use [[email protected]_spacing] to determine how much space will be minimally placed between all children in the `GtkBox`. Note that spacing is added *between* the children.

Use [[email protected]_child_after] to move a child to a different place in the box.

CSS nodes

`GtkBox` uses a single CSS node with name box.

Accessibility

`GtkBox` uses the gtk_accessible_role_group role.

All known sub-classes:

Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.Orientable



2022 vala-language.org