row

Macro row 

Source
macro_rules! row {
    ( $( $ee:expr ),* ) => { ... };
    ( $( $ee:expr ),+ , ) => { ... };
}
Expand description

Make a Row widget

§Syntax

Collection :
   row! [ Items? ]

Items :
   (Item ,)* Item ,?

§Stand-alone usage

When used as a stand-alone macro, row! [/* ... */] is just syntactic sugar for Row::new(kas::collection! [/* ... */]).

In this case, Item may be:

  • A string literal (interpreted as a label widget), optionally followed by an align or pack method call
  • An expression yielding an object implementing Widget<Data = _A>

In case all Item instances are a string literal, the data type of the row! widget will be (); otherwise the data type of the widget is _A where _A is a generic type parameter of the widget.

§Usage within widget layout syntax

When called within widget layout syntax, row! may be evaluated as a recursive macro and the result does not have a specified type, except that methods map_any, align and pack are supported via emulation.

In this case, Item is evaluated using widget layout syntax. This is broadly similar to the above with a couple of exceptions:

  • Supported layout macros do not need to be imported to the module scope
  • An Item may be a #[widget] field of the widget

§Example

let my_widget = kas_widgets::row!["one", "two"];