GtkBoxLayout — Layout manager for placing all children in a single row or column
GtkLayoutManager * | gtk_box_layout_new () |
void | gtk_box_layout_set_homogeneous () |
gboolean | gtk_box_layout_get_homogeneous () |
void | gtk_box_layout_set_spacing () |
guint | gtk_box_layout_get_spacing () |
void | gtk_box_layout_set_baseline_position () |
GtkBaselinePosition | gtk_box_layout_get_baseline_position () |
GtkBaselinePosition | baseline-position | Read / Write |
gboolean | homogeneous | Read / Write |
int | spacing | Read / Write |
GObject ╰── GtkLayoutManager ╰── GtkBoxLayout
GtkBoxLayout implements GtkOrientable.
#include <gtk/gtk.h>
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.
GtkLayoutManager *
gtk_box_layout_new (GtkOrientation orientation
);
Creates a new box layout.
orientation | the orientation for the new layout |
a new box layout
void gtk_box_layout_set_homogeneous (GtkBoxLayout *box_layout
,gboolean homogeneous
);
Sets whether the box layout will allocate the same size to all children.
box_layout | ||
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
box_layout |
void gtk_box_layout_set_spacing (GtkBoxLayout *box_layout
,guint spacing
);
Sets how much spacing to put between children.
box_layout | ||
spacing | the spacing to apply between children |
guint
gtk_box_layout_get_spacing (GtkBoxLayout *box_layout
);
Returns the space that box_layout
puts between children.
box_layout |
the spacing of the layout
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.
box_layout | ||
position |
GtkBaselinePosition
gtk_box_layout_get_baseline_position (GtkBoxLayout *box_layout
);
Gets the value set by gtk_box_layout_set_baseline_position()
.
box_layout |
the baseline position
typedef struct _GtkBoxLayout GtkBoxLayout;
“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
“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
“spacing”
property“spacing” int
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
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkBoxLayout.html