const Ctx = struct {
count: i32 = 0,
};
var _ctx = Ctx{};
const btn1 = lv.Button.init(lv.Screen.active());
_ = btn1.addEventCallback(&_ctx, struct {
pub fn onClicked(event: anytype) void {
const the_ctx = event.userData();
the_ctx.count += 1;
std.debug.print("Clicked, count: {d}\n", .{ the_ctx.count });
}
});
btn1.setAlign(.Center, 0, -40);
const label = lv.Label.init(btn1);
label.setText("Button");
label.center();
The following dependencies need to be met before build:
- zig: v0.11
- sdl2: for SDL2 backend
- gtk3: for GTK3 backend
$ zig build run
- Linux
- Windows
- Free Standing
A backend manages display and input.
- SDL2
- GTK3
- Wayland
- Win32
- Free Standing
- LinuxFB
- DRM
- Custom Display
-
Widgets
- Arc
- Animation Image
- Bar
- Button
- Button matrix
- Calendar
- Chart
- Canvas
- Checkbox
- Drop-down list
- Image
- Image button
- Keyboard
- Label
- LED
- Line
- List
- Menu
- Message box
- Roller
- Scale
- Slider
- Span
- Spinbox
- Spinner
- Switch
- Table
- Tabview
- Text area
- Tile view
- Window
-
Events
-
Animations
-
Styles
-
Layouts
-
Timers
-
Fints
-
Images