Hey Nim community!
I just built nim-easygui - a super lightweight GUI library focused on making Windows desktop apps as simple as possible. Think of it as the "training wheels" for GUI development in Nim!
import src/easygui
discard createWindow("My App", 400, 300)
addLabel("Welcome to Nim!")
addButton("Say Hello") do:
showMessage("Hello from Nim!")
showWindow()
That's it! You get a real Windows GUI with clickable buttons.
I wanted something dead simple for beginners and rapid prototyping. Sometimes you just need a quick GUI without learning a massive framework. Perfect for:
Calculator:
discard createWindow("Calculator", 250, 300)
addLabel("Simple Calculator")
addButton("1") do: showMessage("You clicked 1")
addButton("2") do: showMessage("You clicked 2")
addButton("+") do: showMessage("You clicked plus")
showWindow()
Form:
discard createWindow("User Form", 400, 300)
addLabel("Enter your details:")
addInput("Name", "John Doe")
addInput("Email", "[email protected]")
addButton("Submit") do: showMessage("Form submitted!")
showWindow()
GitHub: https://github.com/BeigeHornet151/nim-easygui
What I'd love from you:
git clone https://github.com/BeigeHornet151/nim-easygui.git
cd nim-easygui
nimble install winim
nim c -r examples/hello_world.nim
The library is intentionally minimal (Windows-only for now), but I think there's value in having something this approachable in the Nim ecosystem.
Question for the community: Do you think Nim needs more "beginner-friendly" libraries like this? Or should we focus on more powerful solutions?
Thanks for checking it out! Let me know what you think 😊
---
PS: The entire source is super readable if you want to see how a minimal GUI library works internally!
auto-GUI generation from proc parameters is happening!
Nice. I mentioned this as a possibility here and in general very much agree that this can be a way for users to need to know much less. FWIW, you may want to up front think about a hierarchy/graph of procs that fire throughout, (akin to cligen.dispatchMulti - one use of which might be MultiMulti.nim.)
Suggest improvements (but keep it simple!)
A GUI library should have at least one (and preferably more than one) screenshot in its readme, not just text.
It seems the repo URL has changed?
https://github.com/aeimi/nim-easygui
If the Nim community backs this project, I can easily make it one of the best beginner-friendly GUI libraries out there
Unfortunately, if it's Windows-only, it won't be of much use to many.