The Row Widget
The row widget arranges child widgets horizontally from left to right. It is one of the primary layout containers, along with column.
Interface
val row: fn(
?#spacing: &f64,
?#padding: &Padding,
?#width: &Length,
?#height: &Length,
?#valign: &VAlign,
&Array<Widget>
) -> Widget
Parameters
- spacing — horizontal space between child widgets in pixels
- padding — space around the row’s edges
- width — row width (
Fill,Shrink,Fixed(px), orFillPortion(n)) - height — row height
- valign — vertical alignment of children within the row (
Top,Center,Bottom)
The positional argument is a reference to an array of child widgets.
Examples
use gui;
use gui::text;
use gui::column;
use gui::row;
use gui::button;
mod icon;
[&window(
#icon: &icon::icon,
#title: &"Row Widget",
&column(
#spacing: &20.0,
#padding: &`All(30.0),
#width: &`Fill,
&[
text(#size: &24.0, &"Row Layout"),
row(
#spacing: &30.0,
&[
text(&"Left"),
text(&"Center"),
text(&"Right")
]
),
row(
#spacing: &10.0,
#valign: &`Center,
&[
button(#padding: &`All(10.0), &text(&"One")),
button(#padding: &`All(10.0), &text(&"Two")),
button(#padding: &`All(10.0), &text(&"Three"))
]
)
]
)
)]

See Also
- Column — vertical layout
- Container — single-child alignment and padding
- Space & Rules — spacing and dividers within layouts