GtkBoxLayout

GtkBoxLayout — Layout manager for placing all children in a single row or column

Properties

GtkBaselinePosition baseline-position Read / Write
gboolean homogeneous Read / Write
gint spacing Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GtkLayoutManager
        ╰── GtkBoxLayout

Implemented Interfaces

GtkBoxLayout implements GtkOrientable.

Includes

#include <gtk/gtk.h>

Description

A GtkBoxLayout is a layout manager that arranges the children of any widget using it into a single row or column, depending on the value of its “orientation” property. Within the other dimension all children all allocated the same size. The GtkBoxLayout will respect the “halign” and “valign” properties of each child widget.

If you want all children to be assigned the same size, you can use the “homogeneous” property.

If you want to specify the amount of space placed between each child, you can use the “spacing” property.

Functions

gtk_box_layout_new ()

GtkLayoutManager *
gtk_box_layout_new (GtkOrientation orientation);

Creates a new box layout.

Parameters

orientation

the orientation for the new layout

 

Returns

a new box layout


gtk_box_layout_set_homogeneous ()

void
gtk_box_layout_set_homogeneous (GtkBoxLayout *box_layout,
                                gboolean homogeneous);

Sets whether the box layout will allocate the same size to all children.

Parameters

box_layout

a GtkBoxLayout

 

homogeneous

TRUE to set the box layout as homogeneous

 

gtk_box_layout_get_homogeneous ()

gboolean
gtk_box_layout_get_homogeneous (GtkBoxLayout *box_layout);

Returns whether the layout is set to be homogeneous.

Return: TRUE if the layout is homogeneous

Parameters

box_layout

a GtkBoxLayout

 

gtk_box_layout_set_spacing ()

void
gtk_box_layout_set_spacing (GtkBoxLayout *box_layout,
                            guint spacing);

Sets how much spacing to put between children.

Parameters

box_layout

a GtkBoxLayout

 

spacing

the spacing to apply between children

 

gtk_box_layout_get_spacing ()

guint
gtk_box_layout_get_spacing (GtkBoxLayout *box_layout);

Returns the space that box_layout puts between children.

Parameters

box_layout

a GtkBoxLayout

 

Returns

the spacing of the layout


gtk_box_layout_set_baseline_position ()

void
gtk_box_layout_set_baseline_position (GtkBoxLayout *box_layout,
                                      GtkBaselinePosition position);

Sets the baseline position of a box layout.

The baseline position 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 the given position is used to allocate the baseline within the extra space available.

Parameters

box_layout

a GtkBoxLayout

 

position

a GtkBaselinePosition

 

gtk_box_layout_get_baseline_position ()

GtkBaselinePosition
gtk_box_layout_get_baseline_position (GtkBoxLayout *box_layout);

Gets the value set by gtk_box_layout_set_baseline_position().

Parameters

box_layout

a GtkBoxLayout

 

Returns

the baseline position

Types and Values

GtkBoxLayout

typedef struct _GtkBoxLayout GtkBoxLayout;

Property Details

The “baseline-position” property

  “baseline-position”        GtkBaselinePosition

The position of the allocated baseline within the extra space allocated to each child of the widget using a box layout manager.

This property is only relevant for horizontal layouts containing at least one child with a baseline alignment.

Owner: GtkBoxLayout

Flags: Read / Write

Default value: GTK_BASELINE_POSITION_CENTER


The “homogeneous” property

  “homogeneous”              gboolean

Whether the box layout should distribute the available space homogeneously among the children of the widget using it as a layout manager.

Owner: GtkBoxLayout

Flags: Read / Write

Default value: FALSE


The “spacing” property

  “spacing”                  gint

The space between each child of the widget using the box layout as its layout manager.

Owner: GtkBoxLayout

Flags: Read / Write

Allowed values: >= 0

Default value: 0