Recent Crystal blog etc about state on GUI and Windows (seperate or combined)

Hi,

I have problems finding any, so quick question:
Is there a recent blog post/article/presentation/etc. about the current state of Crystal on windows?
And the same question for state of GUI in crytal?

If anyone has any links, that would be great :)

To be honest, there probably aren’t many people who have a clear overview of Crystal’s GUI libraries for Windows. You might already be one of the most knowledgeable people on this topic.

As you probably know, I’ve been spending some of my free time working on uing, a binding for libui-ng. But honestly, it’s still nowhere near a level where I can confidently recommend it to others.

Looking at libui-ng, I’ve come to realize that building a simple, lightweight, and truly cross-platform GUI library is no easy task. In reality, it takes the approach of providing three separate libraries—one each for Windows, Mac, and Ubuntu—that look similar but are different under the hood.

libui-ng might often be seen as “old and poorly maintained,” but if you aim for a native, lightweight, cross-platform GUI, this kind of approach is almost unavoidable. And since this approach is already very challenging, even if some talented new developer were to take on this problem again, I doubt the result would be significantly different from libui-ng.

That said, with the recent advances in AI, which can integrate experience and knowledge beyond what any single person can achieve, it’s possible that an AI-driven solution might emerge—one capable of handling the complex integration and maintenance that requires deep expertise in the Windows, Mac, and GTK APIs.

Currently, the most commonly used libraries are gtk4.cr and crystal-imgui. While neither is lightweight, they have a solid track record. I think the key point is how well they actually support Windows.

(Translation from Japanese by ChatGPT)

Maybe I’m missing something, but my problem with libui is “looks good, now can you move this input box slightly to the left and make it slightly wider” - i haven’t found any way to control size of elements.

And of course, I haven’t forgotten about your project!

No, you’re not missing anything.
In libui-ng, you can’t adjust the size or position of individual controls. It’s really a tool designed for simple use cases where that kind of fine-tuning isn’t necessary. I don’t think this will change in the future.

@konovod
How about this? I see you have added Windows to the CI workflow.
naqvis/webview: Crystal bindings to Webview library

my nappgui bingings is in even worse state than your libui-ng bindings - can’t recommend them even to myself)

Webview is well, webview - not as good as native gui but also have positive sides. My personal problem with this library that it doesn’t work on older Windows systems (even win10 before version 2101) unless you distribute ~100Mb of Microsoft Edge Webview2 binaries.

1 Like

With the recent MSYS2 support you can now use GitHub - hugopl/gtk4.cr: GTK4 bindings for Crystal on Windows, as well as many other shards that normally expect a functioning pkg-config or package manager.

Regarding GUI support in general, I really wish we had Cocoa bindings for the macOS.

2 Likes

Thanks for all the replies!
I’ll definitely try the gtk4 bindings, there used to be (autogenerated?) QT bindings?
Does anyone know if they are still working?

1 Like

I’m using Gtk3 nicely on Linux, through the gobject@0.10.0 on Shardbox shard. I didn’t try it on Windows / macOS.

I’d like to try QT bindings, especially see if I can get an Android app.

1 Like

Yes, Qt5.cr.

They don’t, unfortunately. (Also, Qt 5 itself won’t be supported in two days, unless one pays for special enterprise support or something like that).

I know this is difficult to achieve, but I would love to have proper Qt bindings. It would enable me to create cross-platform GUI tools in Crystal which I prefer over C++.

Interesting. I never tried GTK development, but as a user I definitely prefer GTK3 over GTK4+libadwaita.

1 Like

There is also win32cr, although this may not be the main purpose of creating GUI apps.

The new Qt Bridges (vapor at this point in time) are supposed to make bindings very very easy (For QML, not QWidgets)