1/zenith391/zgt v0.85


As of now, zgt is NOT ready for use in production as I'm still making breaking changes


the glorius software in action

Introduction

zgt is a graphical user interface library for Zig. It is mainly intended for creating applications using native controls from the operating system. zgt is a declarative UI library aiming to be easy to write for and versatile.

It has been made with the goal to empower standalone UI applications, integration in games or any other rendering process is a non-goal.

Usage

zgt can be used as any other library using the Zig build package system. It only requires adding this code to your build.zig file (it also manages backend-specific configuration):

try @import("zgt/build.zig").install(exe, "./path/to/zgt");

A simple application using zgt:

const zgt = @import("zgt");
const std = @import("std");

pub fn main() !void {
    try zgt.backend.init();

    var window = try zgt.Window.init();
    try window.set(
        zgt.Column(.{}, .{
            zgt.Row(.{}, .{
                zgt.Button(.{ .label = "Save", .onclick = buttonClicked }),
                zgt.Button(.{ .label = "Run",  .onclick = buttonClicked })
            }),
            // Expanded means the widget will take all the space it can
            // in the parent container
            zgt.Expanded(
                zgt.TextArea(.{ .text = "Hello World!" })
            )
        })
    );

    window.resize(800, 600);
    window.show();
    zgt.runEventLoop();
}

fn buttonClicked(button: *zgt.Button_Impl) !void {
    std.log.info("You clicked button with text {s}", .{button.getLabel()});
}

It is easy to add something like a button or a text area. The example can already be used to notice a widget's parameters are usually enclosed in anonymous structs (.{ .label = "Save" }). You can also see that simply wrapping a widget with zgt.Expanded( ... ) will tell it to take all the space it can.

Package Contents

  • .vscode/tasks.json
  • .gitattributes
  • page.html
  • zigmod.lock
  • LICENSE
  • .github/window_with_a_button.png
  • .github/empty_window.png
  • ziglogo.png
  • zig.sum
  • examples/foo_app.zig
  • examples/tabs.zig
  • examples/entry.zig
  • examples/colors.zig
  • examples/calculator.zig
  • examples/graph.zig
  • examples/demo.zig
  • examples/fade.zig
  • examples/7gui/README.md
  • examples/7gui/counter.zig
  • build.zig
  • src/button.zig
  • src/image.zig
  • src/window.zig
  • src/scrollable.zig
  • src/tabs.zig
  • src/fuzz.zig
  • src/backends/gles/shaders/fragment.glsl
  • src/backends/gles/shaders/vertex.glsl
  • src/backends/gles/backend.zig
  • src/backends/shared.zig
  • src/backends/gtk/backend.zig
  • src/backends/gtk/windowbin.zig
  • src/backends/win32/gdip.zig
  • src/backends/win32/res/resource.rc
  • src/backends/win32/res/manifest.xml
  • src/backends/win32/res/i386.o
  • src/backends/win32/res/README.md
  • src/backends/win32/res/x86_64.o
  • src/backends/win32/gdiplus.def
  • src/backends/win32/backend.zig
  • src/backends/win32/win32.zig
  • src/backends/wasm/backend.zig
  • src/backends/wasm/js.zig
  • src/color.zig
  • src/backend.zig
  • src/internal.zig
  • src/style.zig
  • src/containers.zig
  • src/text.zig
  • src/main.zig
  • src/data.zig
  • src/widget.zig
  • src/canvas.zig
  • src/flat/button.zig
  • src/label.zig
  • src/png.zig
  • README.md
  • zig.mod
  • .gitignore

Dependencies

  • system_lib gtk+-3.0
  • system_lib c

Build Dependencies

  • git https://github.com/Luukdegram/apple_pie

History

Published On Tree @ Commit Size
v0.90 Wed, 11 May 2022 12:22:16 UTC Tree 306.046 KB
v0.89 Wed, 11 May 2022 11:36:26 UTC Tree 306.052 KB
v0.88 Wed, 11 May 2022 11:34:46 UTC Tree 306.021 KB
v0.87 Wed, 11 May 2022 10:22:12 UTC Tree 303.782 KB
v0.86 Wed, 11 May 2022 10:21:39 UTC Tree 303.788 KB
v0.85 Sat, 07 May 2022 11:55:45 UTC Tree 302.838 KB
v0.84 Sun, 01 May 2022 17:11:41 UTC Tree 302.223 KB
v0.83 Sun, 01 May 2022 13:40:03 UTC Tree 301.834 KB
v0.82 Sun, 17 Apr 2022 15:03:36 UTC Tree 300.650 KB
v0.81 Sun, 17 Apr 2022 14:51:14 UTC Tree 299.985 KB
v0.80 Sat, 02 Apr 2022 12:25:54 UTC Tree 299.960 KB
v0.79 Sat, 02 Apr 2022 10:03:30 UTC Tree 299.603 KB
v0.78 Sat, 02 Apr 2022 10:03:03 UTC Tree 296.153 KB
v0.77 Sun, 27 Mar 2022 14:42:49 UTC Tree 295.533 KB
v0.76 Sun, 27 Mar 2022 14:33:48 UTC Tree 295.568 KB
v0.75 Sun, 27 Mar 2022 11:02:24 UTC Tree 292.192 KB
v0.74 Sun, 27 Mar 2022 09:45:08 UTC Tree 292.880 KB
v0.73 Thu, 24 Mar 2022 17:04:16 UTC Tree 292.293 KB
v0.72 Sat, 12 Mar 2022 13:55:51 UTC Tree 290.031 KB
v0.71 Sun, 06 Mar 2022 12:05:06 UTC Tree 289.152 KB
v0.70 Sun, 06 Mar 2022 12:04:04 UTC Tree 289.077 KB
v0.69 Mon, 28 Feb 2022 19:01:23 UTC Tree 285.321 KB
v0.68 Sun, 27 Feb 2022 20:49:55 UTC Tree 285.355 KB
v0.67 Sun, 27 Feb 2022 17:46:51 UTC Tree 284.031 KB
v0.66 Tue, 08 Feb 2022 08:29:58 UTC Tree 278.567 KB
v0.65 Mon, 10 Jan 2022 20:16:07 UTC Tree 272.271 KB
v0.64 Thu, 06 Jan 2022 21:05:30 UTC Tree 268.979 KB
v0.63 Thu, 06 Jan 2022 20:34:23 UTC Tree 268.314 KB
v0.62 Thu, 06 Jan 2022 20:22:23 UTC Tree 266.948 KB
v0.61 Thu, 06 Jan 2022 19:55:11 UTC Tree 266.964 KB
v0.60 Thu, 06 Jan 2022 18:09:24 UTC Tree 266.648 KB
v0.59 Thu, 06 Jan 2022 17:48:41 UTC Tree 264.889 KB
v0.58 Thu, 06 Jan 2022 17:23:16 UTC Tree 264.272 KB
v0.57 Thu, 06 Jan 2022 17:12:59 UTC Tree 247.466 KB
v0.56 Thu, 06 Jan 2022 17:09:16 UTC Tree 246.780 KB
v0.55 Fri, 31 Dec 2021 22:00:44 UTC Tree 246.780 KB
v0.54 Fri, 31 Dec 2021 13:01:41 UTC Tree 246.773 KB
v0.53 Thu, 30 Dec 2021 14:10:23 UTC Tree 244.419 KB
v0.52 Thu, 30 Dec 2021 13:40:08 UTC Tree 243.011 KB
v0.51 Thu, 30 Dec 2021 12:56:22 UTC Tree 242.161 KB
v0.50 Mon, 20 Dec 2021 23:43:12 UTC Tree 241.782 KB
v0.49 Mon, 20 Dec 2021 22:44:12 UTC Tree 240.518 KB
v0.48 Mon, 20 Dec 2021 18:59:10 UTC Tree 239.700 KB
v0.47 Mon, 20 Dec 2021 17:38:22 UTC Tree 237.691 KB
v0.46 Mon, 20 Dec 2021 16:32:15 UTC Tree 236.074 KB
v0.45 Sun, 12 Dec 2021 20:16:19 UTC Tree 215.202 KB
v0.44 Sun, 12 Dec 2021 17:38:58 UTC Tree 212.756 KB
v0.43 Sun, 12 Dec 2021 17:37:50 UTC Tree 212.738 KB
v0.42 Fri, 10 Dec 2021 07:08:40 UTC Tree 212.562 KB
v0.41 Thu, 09 Dec 2021 20:20:40 UTC Tree 212.477 KB
v0.40 Wed, 08 Dec 2021 20:05:59 UTC Tree 209.746 KB
v0.39 Wed, 08 Dec 2021 20:02:27 UTC Tree 209.774 KB
v0.38 Wed, 08 Dec 2021 18:28:53 UTC Tree 209.199 KB
v0.37 Wed, 08 Dec 2021 15:04:50 UTC Tree 208.412 KB
v0.36 Wed, 08 Dec 2021 14:11:15 UTC Tree 205.933 KB
v0.35 Wed, 08 Dec 2021 14:03:58 UTC Tree 206.002 KB
v0.34 Sun, 05 Dec 2021 11:11:11 UTC Tree 200.269 KB
v0.33 Mon, 29 Nov 2021 18:48:06 UTC Tree 199.715 KB
v0.32 Sun, 21 Nov 2021 17:50:38 UTC Tree 205.792 KB
v0.31 Sun, 21 Nov 2021 17:42:37 UTC Tree 205.675 KB
v0.30 Sun, 21 Nov 2021 17:11:09 UTC Tree 205.311 KB
v0.29 Sun, 21 Nov 2021 17:00:32 UTC Tree 204.479 KB
v0.28 Sun, 21 Nov 2021 15:22:27 UTC Tree 202.448 KB
v0.27 Sun, 21 Nov 2021 14:08:43 UTC Tree 198.979 KB
v0.26 Sun, 21 Nov 2021 14:07:33 UTC Tree 199.063 KB
v0.25 Sun, 21 Nov 2021 13:54:50 UTC Tree 198.862 KB
v0.24 Sun, 21 Nov 2021 13:43:17 UTC Tree 198.764 KB
v0.23 Sun, 21 Nov 2021 13:13:41 UTC Tree 196.643 KB
v0.22 Sun, 21 Nov 2021 13:13:03 UTC Tree 196.620 KB
v0.21 Sun, 14 Nov 2021 13:26:53 UTC Tree 195.284 KB
v0.20 Sun, 14 Nov 2021 13:06:00 UTC Tree 200.933 KB
v0.19 Thu, 11 Nov 2021 17:32:52 UTC Tree 199.200 KB
v0.18 Thu, 11 Nov 2021 16:47:18 UTC Tree 198.179 KB
v0.17 Tue, 09 Nov 2021 12:03:34 UTC Tree 193.024 KB
v0.16 Tue, 09 Nov 2021 11:41:28 UTC Tree 191.686 KB
v0.15 Sun, 07 Nov 2021 17:39:04 UTC Tree 191.693 KB
v0.14 Tue, 02 Nov 2021 19:56:19 UTC Tree 191.701 KB
v0.13 Tue, 02 Nov 2021 18:52:26 UTC Tree 188.061 KB
v0.12 Tue, 02 Nov 2021 18:17:39 UTC Tree 187.617 KB
v0.11 Sun, 24 Oct 2021 10:14:56 UTC Tree 172.924 KB
v0.10 Sun, 24 Oct 2021 10:14:14 UTC Tree 173.021 KB
v0.9 Sun, 24 Oct 2021 09:44:16 UTC Tree 171.969 KB
v0.8 Sun, 24 Oct 2021 09:08:49 UTC Tree 170.684 KB
v0.7 Sun, 05 Sep 2021 12:46:14 UTC Tree 103.392 KB
v0.6 Sat, 04 Sep 2021 20:08:50 UTC Tree 101.104 KB
v0.5 Wed, 25 Aug 2021 09:23:52 UTC Tree 100.850 KB
v0.4 Wed, 14 Jul 2021 09:33:12 UTC Tree 99.229 KB
v0.3 Thu, 01 Jul 2021 11:02:44 UTC Tree 94.751 KB
v0.2 Wed, 12 May 2021 19:34:43 UTC Tree 82.249 KB
v0.1 Mon, 12 Apr 2021 18:44:50 UTC Tree 68.051 KB