1
0
Fork 0
This commit is contained in:
namedkitten 2020-08-25 11:36:21 +01:00
parent 70b4978674
commit acd1c30a3d
2 changed files with 4 additions and 4 deletions

View file

@ -215,9 +215,9 @@ pub const Bar = struct {
// instead of looping and getting it, maybe then it would make more sense? // instead of looping and getting it, maybe then it would make more sense?
// Anyway this just strips off the prefix of ',' so I can parse the json. // Anyway this just strips off the prefix of ',' so I can parse the json.
if (line[0] == ',') line = line[1..line.len]; if (line[0] == ',') line = line[1..line.len];
const parseOptions = json.ParseOptions{ .allocator = self.allocator }; const parseOptions = std.json.ParseOptions{ .allocator = self.allocator };
const data = try json.parse(MouseEvent, &json.TokenStream.init(line), parseOptions); const data = try std.json.parse(MouseEvent, &std.json.TokenStream.init(line), parseOptions);
defer json.parseFree(MouseEvent, data, parseOptions); defer std.json.parseFree(MouseEvent, data, parseOptions);
self.dispatch_click_event(data.name, data) catch {}; self.dispatch_click_event(data.name, data) catch {};
// If mouse_event needs to store the event for after the call is finished, // If mouse_event needs to store the event for after the call is finished,

View file

@ -67,7 +67,7 @@ pub fn main() !void {
var br = Bar.init(&bar); var br = Bar.init(&bar);
const widgets = [_]*Widget{ const widgets = [_]*Widget{
&Widget.init(&networkWidget.New(allocator, &br)), // 24.01KiB //&Widget.init(&networkWidget.New(allocator, &br)), // 24.01KiB
&Widget.init(&cpuWidget.New(&br)), // 4.08KiB &Widget.init(&cpuWidget.New(&br)), // 4.08KiB
&Widget.init(&memoryWidget.New(&br)), // 4.08KiB &Widget.init(&memoryWidget.New(&br)), // 4.08KiB
&Widget.init(&weatherWidget.New(allocator, &br, @import("build_options").weather_location)), // 16.16KiB &Widget.init(&weatherWidget.New(allocator, &br, @import("build_options").weather_location)), // 16.16KiB