init
It's expected to call this when self is undefined
Parameters
- self:*VirtualParentWidget
- *VirtualParentWidget
- src:std.builtin.SourceLocation
- std.builtin.SourceLocation
- opts:Options
- Options
Source
Implementation
pub fn init(self: *VirtualParentWidget, src: std.builtin.SourceLocation, opts: Options) void {
const id = dvui.parentGet().extendId(src, opts.idExtra());
const rect = dvui.dataGet(null, id, "_rect", Rect);
const defaults = Options{ .name = "Virtual Parent", .rect = rect orelse .{}, .expand = .both };
self.* = .{ .wd = WidgetData.init(src, .{}, defaults.override(opts)) };
dvui.parentSet(self.widget());
self.data().register();
}