nektro / zigquestions

A Zig community to ask for help for any experience level. Open an issue to get started :)
50 stars 0 forks source link

Best way to make a cross-platform GUI app in Zig? #1

Closed TUSF closed 1 year ago

nektro commented 1 year ago

there are many fledgling tools to accomplish this task and the best one to choose will all depend on your specific goals. below is a selection of some currently being worked on:

GUI Toolkits

GUI Toolkit Bindings

Graphics Libraries

Component/Other Libraries

raspberrypisig commented 10 months ago

That's a great list!

Normally, I don't write immediate mode gui apps.

I recently decided to build a simple tool. Initially, I was tempted to go with the libui-ng binding for zig(the one mentioned in the list above, which is great), because of native controls on Windows, linux(raspberry pi) and Mac.

But then I realised that native controls are very restricted in terms of layout and styling and especially forms tend to be two column chock full of controls(like the controls suite examples, suited to something like Rufus style apps).

Then I stumbled over raygui, a sister project of raylib. There are a number of free GUI tools that the author has created(eg. RGuiStyler) for doing things like creating custom styles, icons etc.

raygui has a number of bindings for various languages. I eventually ended up writing the tool using the python binding because of the changes in the build system in the latest zig master, but the zig binding (https://github.com/ryupold/raygui.zig) is good too when they get that working again. (https://github.com/ryupold/examples-raylib.zig/issues/12)

One thing to note is that they keep examples in a separate repo to the binding project under the same author.