Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.25 KB

README.md

File metadata and controls

33 lines (21 loc) · 1.25 KB

zig-gtk

Thin Zig wrapper for GTK 4.

🚧 Very much a work in progress... 🚧

Naming convention

Type names and method names of the original C library were changed to follow the Zig Style Guide. For example, a method like gtk_grid_view_set_single_click_activate(grid_view, single_click_activate) in GTK C becomes a method belonging to the GridView struct and can be called like grid_view.setSingleClickActivate(single_click_activate) in zig-gtk.

Status

This is currently very incomplete. Only a small number of types have been wrapped, and those that have aren't fully wrapped. I have only been binding the types and methods I need in my projects for now.

PRs are very welcome to add more bindings.

Usage

zig-gtk depends on zig-glib, so add this module too. Then add the following to your build.zig:

const glib = std.build.Pkg{ .name = "glib", .path = .{ .path = "deps/zig-glib/glib.zig" } };
const gtk = std.build.Pkg{
    .name = "gtk",
    .path = .{ .path = "deps/zig-gtk/gtk.zig" },
    .dependencies = &[_]std.build.Pkg{glib},
};

exe.addPackage(glib);
exe.addPackage(gtk);

exe.linkSystemLibrary("gtk4");