Skip to content

ufbycd/zlvgl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zlvgl - zig binding for lvgl

Code Example

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();

Build

The following dependencies need to be met before build:

  • zig: v0.11
  • sdl2: for SDL2 backend
  • gtk3: for GTK3 backend

Run Example

$ zig build run

Supported Features

Platforms

  • Linux
  • Windows
  • Free Standing

Backends

A backend manages display and input.

  • SDL2
  • GTK3
  • Wayland
  • Win32
  • Free Standing

Displays

  • LinuxFB
  • DRM
  • Custom Display

LVGL Components

  • 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

About

LVGL binding for zig.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.1%
  • Python 0.6%
  • C++ 0.2%
  • Zig 0.1%
  • CMake 0.0%
  • Ruby 0.0%