DVUI

box

Box that packs children with gravity 0 or 1, or anywhere with gravity between (0,1).

A child with gravity between (0,1) in dir direction is not packed, and instead positioned in the whole box area, like overlay.

A child with gravity 0 or 1 in dir direction is packed either at the start (gravity 0) or end (gravity 1).

Extra space is allocated evenly to all packed children expanded in dir direction.

If init_opts.equal_space is true, all packed children get equal space.

See flexbox.

Only valid between Window.beginand Window.end.

Parameters

#
src:std.builtin.SourceLocation
std.builtin.SourceLocation
init_opts:BoxWidget.InitOptions
BoxWidget.InitOptions
opts:Options
Options

Source

Implementation

#
pub fn box(src: std.builtin.SourceLocation, init_opts: BoxWidget.InitOptions, opts: Options) *BoxWidget {
    var ret = widgetAlloc(BoxWidget);
    ret.init(src, init_opts, opts);
    ret.drawBackground();
    return ret;
}