ref(event): remove .resize and replace with recursize method calls
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 40s

This also means that currently the dynamic resizing through the app's
detached thread is not working, as it cannot send size updates. The
examples have been overhauled to still implement intermediate mode
applications accordingly.
This commit is contained in:
2025-03-04 14:52:19 +01:00
parent 43cdc46853
commit ec22e68e8c
17 changed files with 334 additions and 224 deletions

View File

@@ -108,10 +108,8 @@ pub fn main() !void {
const event = app.nextEvent();
log.debug("received event: {s}", .{@tagName(event)});
// pre event handling
switch (event) {
.init => continue,
.quit => break,
.size => |size| try renderer.resize(size),
.key => |key| {
if (key.eql(.{ .cp = 'c', .mod = .{ .ctrl = true } })) app.quit();
@@ -140,6 +138,16 @@ pub fn main() !void {
.msg = "Container Event handling failed",
},
});
// post event handling
switch (event) {
.quit => break,
else => {},
}
try renderer.resize();
container.reposition(.{});
container.resize(renderer.size);
try renderer.render(@TypeOf(container), &container);
try renderer.flush();
}