From 019669d2f0237267c9837672c2a3433b415301b7 Mon Sep 17 00:00:00 2001 From: forgoty Date: Tue, 30 Apr 2024 01:03:54 +0300 Subject: [PATCH] Fix examples: main, pathological, table. --- examples/main.zig | 2 +- examples/pathological.zig | 2 +- examples/table.zig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/main.zig b/examples/main.zig index 9bff3bc..b7537c5 100644 --- a/examples/main.zig +++ b/examples/main.zig @@ -15,7 +15,7 @@ pub fn main() !void { const alloc = gpa.allocator(); // Initialize Vaxis - var vx = try vaxis.init(.{}); + var vx = try vaxis.init(alloc, .{}); defer vx.deinit(alloc); var loop: vaxis.Loop(Event) = .{ .vaxis = &vx }; diff --git a/examples/pathological.zig b/examples/pathological.zig index 2e9d664..1d81510 100644 --- a/examples/pathological.zig +++ b/examples/pathological.zig @@ -11,7 +11,7 @@ const Event = union(enum) { pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const alloc = gpa.allocator(); - var vx = try vaxis.init(.{}); + var vx = try vaxis.init(alloc, .{}); errdefer vx.deinit(alloc); var loop: vaxis.Loop(Event) = .{ .vaxis = &vx }; diff --git a/examples/table.zig b/examples/table.zig index ccbb926..3166a10 100644 --- a/examples/table.zig +++ b/examples/table.zig @@ -25,7 +25,7 @@ pub fn main() !void { const user_list = std.ArrayList(User).fromOwnedSlice(alloc, users_buf); defer user_list.deinit(); - var vx = try vaxis.init(.{}); + var vx = try vaxis.init(alloc, .{}); defer vx.deinit(alloc); var loop: vaxis.Loop(union(enum) { @@ -57,7 +57,7 @@ pub fn main() !void { }; var title_segs = [_]vaxis.Cell.Segment{ title_logo, title_info, title_disclaimer }; - var cmd_input = vaxis.widgets.TextInput.init(alloc); + var cmd_input = vaxis.widgets.TextInput.init(alloc, &vx.unicode); defer cmd_input.deinit(); // Colors