DVUI

init

It's expected to call this when self is undefined

Parameters

#
self:*FlexBoxWidget
*FlexBoxWidget
src:std.builtin.SourceLocation
std.builtin.SourceLocation
init_opts:InitOptions
InitOptions
opts:Options
Options

Source

Implementation

#
pub fn init(self: *FlexBoxWidget, src: std.builtin.SourceLocation, init_opts: InitOptions, opts: Options) void {
    const defaults = Options{ .name = "FlexBox" };
    self.* = .{
        .wd = WidgetData.init(src, .{}, defaults.override(opts)),
        .init_options = init_opts,
        // SAFETY: Set bellow
        .prevClip = undefined,
    };
    if (dvui.dataGet(null, self.data().id, "_mrw", f32)) |mrw| self.max_row_width_prev = mrw;

    self.data().register();
    dvui.parentSet(self.widget());

    self.prevClip = dvui.clip(self.data().contentRectScale().r);
}