this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

examples: update text_input

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>

+10 -2
+10 -2
examples/text_input.zig
··· 43 43 // enum has the fields for those events (ie "key_press", "winsize") 44 44 switch (event) { 45 45 .key_press => |key| { 46 - color_idx += 1; 46 + color_idx = switch (color_idx) { 47 + 255 => 0, 48 + else => color_idx + 1, 49 + }; 47 50 text_input.update(.{ .key_press = key }); 48 51 if (key.codepoint == 'c' and key.mods.ctrl) { 49 52 break :outer; ··· 63 66 // vaxis double buffers the screen. This new frame will be compared to 64 67 // the old and only updated cells will be drawn 65 68 win.clear(); 66 - const child = win.initChild(win.width / 2 - 20, win.height / 2 - 3, .{ .limit = 40 }, .{ .limit = 3 }); 69 + const child = win.initChild( 70 + win.width / 2 - 20, 71 + win.height / 2 - 3, 72 + .{ .limit = 40 }, 73 + .{ .limit = 3 }, 74 + ); 67 75 // draw the text_input using a bordered window 68 76 const style: vaxis.Style = .{ 69 77 .fg = .{ .index = color_idx },