use tui::widget;

export type vlayout = struct {
	layout: layout,
};

export fn newvlayout(widgets: *widget::widget...) vlayout = {
	return vlayout {
		layout = layout {
			widgets = widgets,
			print = &printvlayout,
			finish = &finishvlayout,
		},
	};
};

fn printvlayout(l: *layout) void = {
	for (let widget .. l.widgets) {
		widget.print(widget);
	};
};

export fn finishvlayout(l: *layout) void = {
	let vl = l: *vlayout;
	finish(&vl.layout);
};
