Is there a recommended GUI library for nim?
I notice that with a Windows install one of the DLLs is libui.dll, but there're also SDL2 DLLs. I'm looking for a GUI library that I can use to build apps on Linux and Windows (don't need macOS).
I've now tried the "hello world" program for all those that claim to be cross-platform (at least Linux & Windows). Most don't actually work on Windows, and all but one requires at least one .so or .dll.
The one exception is NiGui. This is pure Nim so doesn't need any extra shared libraries. Also, I found it worked fine on both Linux and Windows. I haven't tested it for performance or for comprehensiveness, and the documentation is rather sparse. However, it comes with a whole bunch of examples which are small enough to study and learn from.
I really hope that NiGUI gets the support it needs. For example, after decades, Python still has no native GUI library (although there have been many attempts, e.g., PyGUI). This makes it much harder to deploy Python GUI apps. Yet with NiGUI deployment is easy since it is built right into the executable with no separate libraries.
The best/most advanced gui library for nim is afaik gintro (gtk).
I can also recommend web view for smaller things.
Hello, I personally use the wxWidgets bindings. There isn't a ton of documentation on the Nim bindings specifically, but between the examples and wxWidgets c++ documentation, it is easy enough to navigate. Check out he wxWidgets window creation example I just uploaded to Rosetta Code, https://rosettacode.org/wiki/Window_creation#wxWidgets
I'm on MacOS, but wxWidgets is cross platform, and the github page has installation instructions for Windows and Linux. I am using the pmunch branch:
https://github.com/pmunch/wxnim
It does have some dependencies. First of all you need to install wxWidgets separately then the bindings. On MacOS it calls out to some dlls that I end up including with the executable. There is probably a way to statically link to them but I haven't taken the time to try that yet. on MacOS I only need to ship 2 dlls with my executable and they are small
I didn't even know there was a wxWidgets port. When I searched the nimble package site for "gui" it didn't find it (maybe it isn't there) and nor is it mentioned in the Curated Packages. Probably good if you put it in one or both those places so people could find it:-)
Also might help if you list the .so's, .dylib's and .DLLs that need to be distributed with an nim executable.
Anyway, I'll give it a try!
Tangential: I haven't done GUI work in a long long long time, but I discovered FLTK in 1998 (then pre-1.0), and came back to it again and again, last time in 2012, for the simple reason that it never flickered thanks to built-in double buffering - and every other toolkit, even in 2012, had cases where it did.
I don't know if it's still a problem these days, but if it s - GUI toolkit developers, please pay attention to it.
there is a C interface to fltk by D. J. Peters for freebasic language. But since dynamic library is supplied, we can use FLTK-C in other language. As a result, I translate the rich freebasic examples into nim. You can check it at https://github.com/retsyo/FLTK_nim
However, I use windows, maybe you have to adjust the code to make it runs on Linux.
BTW, is it possible to change the theme in FLTK? The default looking is too nostalgic.
Also trying to find a NIM GUI lib... TCL with Python is fine - is there any analog for NIM?
Function needed: Buttons, labels, text fields, tree or expanded view, grid placing?
Also what is the best for real time plotting of math graphics? With grig, axis, labels?
Dreaming to find all of it on native NIM with no dependencies...