Fix examples: main, pathological, table.

This commit is contained in:
forgoty 2024-04-30 01:03:54 +03:00 committed by Tim Culverhouse
parent 4e3a53c536
commit 019669d2f0
3 changed files with 4 additions and 4 deletions

View file

@ -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 };

View file

@ -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 };

View file

@ -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