h
This commit is contained in:
parent
70b4978674
commit
acd1c30a3d
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue