feat: use explicit error handling for all startup errors

This commit is contained in:
CJ van den Berg 2025-03-25 17:12:01 +01:00
parent fc3224137d
commit a1b2737c5d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
12 changed files with 116 additions and 50 deletions

View file

@ -31,7 +31,7 @@ on_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_re
after_render: *const fn (ctx: ?*anyopaque, theme: *const Widget.Theme) void = on_render_default,
on_resize: *const fn (ctx: ?*anyopaque, self: *Self, pos_: Widget.Box) void = on_resize_default,
pub fn createH(allocator: Allocator, parent: Plane, name: [:0]const u8, layout_: Layout) !*Self {
pub fn createH(allocator: Allocator, parent: Plane, name: [:0]const u8, layout_: Layout) error{OutOfMemory}!*Self {
const self: *Self = try allocator.create(Self);
self.* = try init(allocator, parent, name, .horizontal, layout_, Box{});
self.plane.hide();