Class CenterBox

All Implemented Interfaces:
PointerInterface

public class CenterBox extends Widget
`GtkCenterBox` arranges three children in a row, keeping the middle child
centered as well as possible.

![An example GtkCenterBox](centerbox.png)

To add children to `GtkCenterBox`, use [method@Gtk.CenterBox.set_start_widget],
[method@Gtk.CenterBox.set_center_widget] and
[method@Gtk.CenterBox.set_end_widget].

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

# GtkCenterBox as GtkBuildable

The `GtkCenterBox` implementation of the `GtkBuildable` interface
supports placing children in the 3 positions by specifying “start”, “center”
or “end” as the “type” attribute of a <child> element.

# CSS nodes

`GtkCenterBox` uses a single CSS node with the name “box”,

The first child of the `GtkCenterBox` 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

`GtkCenterBox` uses the %GTK_ACCESSIBLE_ROLE_GROUP role.

https://docs.gtk.org/gtk4/class.CenterBox.html

  • Constructor Details

    • CenterBox

      public CenterBox(PointerContainer pointer)
    • CenterBox

      public CenterBox()
      Creates a new `GtkCenterBox`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getBaselinePosition

      public int getBaselinePosition()
      Gets the value set by gtk_center_box_set_baseline_position().
      Returns:
      the baseline position
    • getCenterWidget

      public Widget getCenterWidget()
      Gets the center widget, or %NULL if there is none.
      Returns:
      the center widget.
    • getEndWidget

      public Widget getEndWidget()
      Gets the end widget, or %NULL if there is none.
      Returns:
      the end widget.
    • getStartWidget

      public Widget getStartWidget()
      Gets the start widget, or %NULL if there is none.
      Returns:
      the start widget.
    • setBaselinePosition

      public void setBaselinePosition(int position)
      Sets the baseline position of a center box.

      This affects only horizontal boxes with at least one baseline
      aligned child. If there is more vertical space available than
      requested, and the baseline is not allocated by the parent then
      @position is used to allocate the baseline wrt. the extra space
      available.
      Parameters:
      position - a `GtkBaselinePosition`
    • setCenterWidget

      public void setCenterWidget(@Nullable Widget child)
      Sets the center widget.

      To remove the existing center widget, pas %NULL.
      Parameters:
      child - the new center widget
    • setEndWidget

      public void setEndWidget(@Nullable Widget child)
      Sets the end widget.

      To remove the existing end widget, pass %NULL.
      Parameters:
      child - the new end widget
    • setStartWidget

      public void setStartWidget(@Nullable Widget child)
      Sets the start widget.

      To remove the existing start widget, pass %NULL.
      Parameters:
      child - the new start widget
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asOrientable

      public Orientable asOrientable()
      Implements interface Orientable. Call this to get access to interface functions.
      Returns:
      Orientable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()