Package org.gnome.gtk

Class Box

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Buildable, ConstraintTarget, Orientable
Direct Known Subclasses:
ShortcutsGroup, ShortcutsSection

@Generated("io.github.jwharm.JavaGI") public class Box extends Widget implements Accessible, Buildable, ConstraintTarget, Orientable
The GtkBox widget arranges child widgets into a single row or column.

An example GtkBox

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

Use repeated calls to append(org.gnome.gtk.Widget) to pack widgets into a GtkBox from start to end. Use remove(org.gnome.gtk.Widget) to remove widgets from the GtkBox. insertChildAfter(org.gnome.gtk.Widget, org.gnome.gtk.Widget) can be used to add a child at a particular position.

Use setHomogeneous(boolean) to specify whether or not all children of the GtkBox are forced to get the same amount of space.

Use setSpacing(int) to determine how much space will be minimally placed between all children in the GtkBox. Note that spacing is added between the children.

Use reorderChildAfter(org.gnome.gtk.Widget, org.gnome.gtk.Widget) to move a child to a different place in the box.

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

Accessibility
Until GTK 4.10, GtkBox used the GTK_ACCESSIBLE_ROLE_GROUP role.

Starting from GTK 4.12, GtkBox uses the GTK_ACCESSIBLE_ROLE_GENERIC role.