5 ms·
This looks great for those small TUI’s that you think “gosh I’d like a simple CLI to automate this”! Being able to produce small binaries or self contained sta
by elcritch 4y ago
This looks great for those small TUI’s that you think “gosh I’d like a simple CLI to automate this”! Being able to produce small binaries or self contained static ones with a few compile flags is really great.
As someone working on a Nim widget library (and funny enough currently stuck on fixing up the text editing story..) I find this doubly interesting. Now I kinda want to see if I could plug this into a widget for it for kicks. Hmmm…
@sekao you might find this macro I split out recently useful if you want to tryout a Kivy-like api (gui things inspired my need for it):
https://github.com/elcritch/cdecl/blob/ee3b06f52e666b2a854eb79a47a50c62b5f2b1d7/tests/testApplies.nim#L64 https://github.com/elcritch/cdecl/blob/ee3b06f52e666b2a854eb...
I also found that `useState` pattern from React with the variant library a handy pattern: https://github.com/yglukhov/variant https://github.com/yglukhov/variant and it’s pretty simple to do if you already have a context object: https://github.com/elcritch/fidgetty/blob/f65876af34797f308b8d367124c76d8305daa158/src/fidgetty/widgets.nim#L247 https://github.com/elcritch/fidgetty/blob/f65876af34797f308b...
Sorry for the link spamming, I just find the overlap of UI state management without OO interesting!