add(widget/List): initial list widget; used in tabs.zig example
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m34s

This commit is contained in:
2024-11-23 22:41:42 +01:00
parent c0c7b9f925
commit 8d68945100
3 changed files with 136 additions and 3 deletions

View File

@@ -67,9 +67,11 @@ pub fn main() !void {
.layout = Layout.createFrom(margin: {
var margin = Layout.Margin.init(allocator, .{ .margin = 10 }, .{
.widget = Widget.createFrom(blk: {
const file = try std.fs.cwd().openFile("./examples/padding.zig", .{});
defer file.close();
var widget = Widget.RawText.init(allocator, file);
var widget = Widget.List.init(allocator, .ordered, .{
&[_]Cell{.{ .content = "First entry" }},
&[_]Cell{.{ .content = "Second entry" }},
&[_]Cell{.{ .content = "Third entry" }},
});
break :blk &widget;
}),
});