GtkCenterBox

gtk.center_box.CenterBox arranges three children in a row, keeping the middle child centered as well as possible.

An example GtkCenterBox

To add children to gtk.center_box.CenterBox, use gtk.center_box.CenterBox.setStartWidget, gtk.center_box.CenterBox.setCenterWidget and gtk.center_box.CenterBox.setEndWidget.

The sizing and positioning of children can be influenced with the align and expand properties of the children.

GtkCenterBox as GtkBuildable

The gtk.center_box.CenterBox implementation of the gtk.buildable.Buildable interface supports placing children in the 3 positions by specifying “start”, “center” or “end” as the “type” attribute of a <child> element.

CSS nodes

gtk.center_box.CenterBox uses a single CSS node with the name “box”,

The first child of the gtk.center_box.CenterBox will be allocated depending on the text direction, i.e. in left-to-right layouts it will be allocated on the left and in right-to-left layouts on the right.

In vertical orientation, the nodes of the children are arranged from top to bottom.

Accessibility

Until GTK 4.10, gtk.center_box.CenterBox used the gtk.types.AccessibleRole.Group role.

Starting from GTK 4.12, gtk.center_box.CenterBox uses the gtk.types.AccessibleRole.Generic role.

struct GtkCenterBox