Skip to content

Commit

Permalink
update binding
Browse files Browse the repository at this point in the history
nothing
  • Loading branch information
jinzhongjia committed Jan 23, 2024
1 parent cc48e1d commit 27e3757
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const WebUI = @cImport({
@cInclude("webui.h");
});

pub const Self = @This();
const Self = @This();

pub const Browsers = enum(u8) {
NoBrowser = 0, // 0. No web browser
Expand Down Expand Up @@ -489,6 +489,12 @@ pub fn binding(self: *Self, element: []const u8, comptime callback: anytype) usi
if (param.type) |tt| {
const paramTInfo = @typeInfo(tt);
switch (paramTInfo) {
.Struct => {
if (i != 0) {
@compileError("you can only use Event and Event must be the first param");
}
param_tup[i] = e;
},
.Bool => {
const res = getBoolAt(e, i);
param_tup[i] = res;
Expand Down

0 comments on commit 27e3757

Please sign in to comment.