It derives from <GtkWidget>.
A box-like widget that can wrap into multiple lines.
<AdwWrapBox> is similar to
<GtkBox>, but can wrap lines when the widgets
cannot fit otherwise. Unlike <GtkFlowBox>,
the children aren’t arranged into a grid and behave more like words in a
wrapping label.
Like <GtkBox>, <AdwWrapBox>
is orientable and has spacing:
WrapBox:child-spacing between children in the same line;
WrapBox:line-spacing between lines.
::: note Unlike <GtkBox>,
<AdwWrapBox> cannot follow the CSS
border-spacing property.
Use the WrapBox:natural-line-length property to determine the
layout’s natural size, e.g. when using it in a
<GtkPopover>.
Normally, a horizontal <AdwWrapBox> wraps left to
right and top to bottom for left-to-right languages. Both of these
directions can be reversed, using the WrapBox:pack-direction and
WrapBox:wrap-reverse properties. Additionally, the alignment of
each line can be controlled with the WrapBox:align property.
Lines can be justified using the WrapBox:justify property,
filling the entire line by either increasing child size or spacing
depending on the value. Set WrapBox:justify-last-line to justify
the last line as well.
By default, <AdwWrapBox> wraps as soon as the
previous line cannot fit any more children without shrinking them past
their natural size. Set WrapBox:wrap-policy to
Adw.WrapPolicy.minimum to only wrap once all the children in the
previous line have been shrunk to their minimum size.
To make each line take the same amount of space, set
WrapBox:line-homogeneous to TRUE.
Spacing and natural line length can scale with the text scale factor,
use the WrapBox:child-spacing-unit,
WrapBox:line-spacing-unit and/or
WrapBox:natural-line-length-unit properties to enable that
behavior.
See WrapLayout.
<AdwWrapBox> uses a single CSS node with name
wrap-box.
<AdwWrapBox> uses the
Gtk.AccessibleRole.group role.
The alignment of the children within each line.
0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.
Alignment is only used when WrapBox:justify is set to
Adw.JustifyMode.none, or on the last line when the
WrapBox:justify-last-line is FALSE.
Its value is a real number.
Set it with (set! (wrap-box:align self) value).
The spacing between widgets on the same line.
See WrapBox:child-spacing-unit.
Its value is a 32-bit integer.
Set it with (set! (wrap-box:child-spacing self) value).
The length unit for child spacing.
Allows the spacing to vary depending on the text scale factor.
See WrapBox:child-spacing.
Its value is a <AdwLengthUnit> (or, to set it,
one of its symbols).
Set it with (set! (wrap-box:child-spacing-unit self) value).
Determines whether and how each complete line should be stretched to fill the entire widget.
If set to Adw.JustifyMode.fill, each widget in the line will be
stretched, keeping consistent spacing, so that the line fills the entire
widget.
If set to Adw.JustifyMode.spread, the spacing between widgets
will be increased, keeping widget sizes intact. The first and last
widget will be aligned with the beginning and end of the line. If the
line only contains a single widget, it will be stretched regardless.
If set to Adw.JustifyMode.none, the line will not be stretched
and the children will be placed together within the line, according to
WrapBox:align.
By default this doesn’t affect the last line, as it will be incomplete.
Use WrapBox:justify-last-line to justify it as well.
Its value is a <AdwJustifyMode> (or, to set
it, one of its symbols).
Set it with (set! (wrap-box:justify self) value).
Whether the last line should be stretched to fill the entire widget.
See WrapBox:justify.
Its value is a boolean.
Set it with (set! (wrap-box:justify-last-line self) value).
Whether all lines should take the same amount of space.
Its value is a boolean.
Set it with (set! (wrap-box:line-homogeneous self) value).
The spacing between lines.
See WrapBox:line-spacing-unit.
Its value is a 32-bit integer.
Set it with (set! (wrap-box:line-spacing self) value).
The length unit for line spacing.
Allows the spacing to vary depending on the text scale factor.
See WrapBox:line-spacing.
Its value is a <AdwLengthUnit> (or, to set it,
one of its symbols).
Set it with (set! (wrap-box:line-spacing-unit self) value).
Determines the natural size for each line.
It should be used to limit the line lengths, for example when used in popovers.
See WrapBox:natural-line-length-unit.
Its value is a 32-bit integer.
Set it with (set! (wrap-box:natural-line-length self) value).
The length unit for natural line length.
Allows the length to vary depending on the text scale factor.
See WrapBox:natural-line-length.
Its value is a <AdwLengthUnit> (or, to set it,
one of its symbols).
Set it with (set! (wrap-box:natural-line-length-unit self)
value).
The direction children are packed in each line.
Its value is a <AdwPackDirection> (or, to
set it, one of its symbols).
Set it with (set! (wrap-box:pack-direction self) value).
The policy for line wrapping.
Adw.WrapPolicy.natural, the box will wrap to the next
line as soon as the previous line cannot fit any more children without
shrinking them past their natural size.
If set to Adw.WrapPolicy.minimum, the box will try to fit as many
children into each line as possible, shrinking them down to their
minimum size before wrapping to the next line.
Its value is a <AdwWrapPolicy> (or, to set it,
one of its symbols).
Set it with (set! (wrap-box:wrap-policy self) value).
Whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the
end in a vertical box. If set to TRUE, they wrap upwards or
towards the start respectively.
Its value is a boolean.
Set it with (set! (wrap-box:wrap-reverse self) value).
Adds child as the last child to self.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <GtkWidget>.
the widget to append
Gets the alignment of the children within each line.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a real number.
the child alignment
Gets spacing between widgets on the same line.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a 32-bit integer.
spacing between widgets on the same line
Gets the length unit for child spacing.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwLengthUnit>.
the length unit
Gets whether and how each complete line is stretched to fill the entire widget.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwJustifyMode>.
the justify mode
Gets whether the last line should be stretched to fill the entire widget.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a boolean.
whether the last line is justified
Gets whether all lines should take the same amount of space.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a boolean.
whether lines should be homogeneous
Gets the spacing between lines.
See WrapBox:line-spacing-unit.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a 32-bit integer.
the line spacing
Gets the length unit for line spacing.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwLengthUnit>.
the length unit
Gets the natural size for each line.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a 32-bit integer.
the natural length
Gets the length unit for line spacing.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwLengthUnit>.
the length unit
Gets the direction children are packed in each line.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwPackDirection>.
the line direction
Gets the policy for line wrapping.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a <AdwWrapPolicy>.
the wrap policy
Gets whether wrap direction is reversed.
Passed: a <AdwWrapBox>.
a wrap box
Returned: a boolean.
whether wrap direction is reversed
Inserts child in the position after sibling in the list of self children.
If sibling is NULL, inserts child at the first
position.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <GtkWidget>.
the widget to insert
Passed, or left out: a <GtkWidget>, or
#f.
the sibling after which to insert child
Creates a new <AdwWrapBox>.
Returned: a <GtkWidget>.
the newly created <AdwWrapBox>
Adds child as the first child to self.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <GtkWidget>.
the widget to prepend
Removes a child widget from self.
The child must have been added before with wrap-box:append, wrap-box:prepend, or wrap-box:insert-child-after.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <GtkWidget>.
the child to remove
Removes all children from self.
Passed: a <AdwWrapBox>.
a wrap box
Moves child to the position after sibling in the list of self children.
If sibling is NULL, moves child to the first
position.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <GtkWidget>.
the widget to move, must be a child of self
Passed, or left out: a <GtkWidget>, or
#f.
the sibling to move child after
Sets the alignment of the children within each line.
0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.
Alignment is only used when WrapBox:justify is set to
Adw.JustifyMode.none, or on the last line when the
WrapBox:justify-last-line is FALSE.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a real number.
the child alignment
Sets the spacing between widgets on the same line.
See WrapBox:child-spacing-unit.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a 32-bit integer.
the child spacing
Sets the length unit for child spacing.
Allows the spacing to vary depending on the text scale factor.
See WrapBox:child-spacing.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwLengthUnit>, or one of its
symbols.
the length unit
Determines whether and how each complete line should be stretched to fill the entire widget.
If set to Adw.JustifyMode.fill, each widget in the line will be
stretched, keeping consistent spacing, so that the line fills the entire
widget.
If set to Adw.JustifyMode.spread, the spacing between widgets
will be increased, keeping widget sizes intact. The first and last
widget will be aligned with the beginning and end of the line. If the
line only contains a single widget, it will be stretched regardless.
If set to Adw.JustifyMode.none, the line will not be stretched
and the children will be placed together within the line, according to
WrapBox:align.
By default this doesn’t affect the last line, as it will be incomplete.
Use WrapBox:justify-last-line to justify it as well.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwJustifyMode>, or one of its
symbols.
the justify mode
Sets whether the last line should be stretched to fill the entire widget.
See WrapBox:justify.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a boolean.
whether to justify the last line
Sets whether all lines should take the same amount of space.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a boolean.
whether lines should be homogeneous
Sets the spacing between lines.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a 32-bit integer.
the line spacing
Sets the length unit for line spacing.
Allows the spacing to vary depending on the text scale factor.
See WrapBox:line-spacing.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwLengthUnit>, or one of its
symbols.
the length unit
Sets the natural size for each line.
It should be used to limit the line lengths, for example when used in popovers.
See WrapBox:natural-line-length-unit.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a 32-bit integer.
the natural length
Sets the length unit for natural line length.
Allows the length to vary depending on the text scale factor.
See WrapBox:natural-line-length.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwLengthUnit>, or one of its
symbols.
the length unit
Sets the direction children are packed in each line.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwPackDirection>, or one of its
symbols.
the new line direction
Sets the policy for line wrapping.
If set to Adw.WrapPolicy.natural, the box will wrap to the next
line as soon as the previous line cannot fit any more children without
shrinking them past their natural size.
If set to Adw.WrapPolicy.minimum, the box will try to fit as many
children into each line as possible, shrinking them down to their
minimum\ size before wrapping to the next line.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a <AdwWrapPolicy>, or one of its
symbols.
the new wrap policy
Sets whether wrap direction should be reversed.
By default, lines wrap downwards in a horizontal box, and towards the
end in a vertical box. If set to TRUE, they wrap upwards or
towards the start respectively.
Passed: a <AdwWrapBox>.
a wrap box
Passed: a boolean.
whether to reverse wrap direction