4 ms·
FLTK is the classic lightweight toolkit. Their "Hello world" example from the documentation is 15 lines[1]. Possibly more importantly it is also very lightweigh
by zokier 8y ago
FLTK is the classic lightweight toolkit. Their "Hello world" example from the documentation is 15 lines[1]. Possibly more importantly it is also very lightweight in terms of memory footprint, the docs advertise[2]:
> * The "core" (the "hello" program compiled & linked with a static FLTK library using gcc on a 486 and then stripped) is 114K.
> * The FLUID program (which includes every widget) is 538k.
While that is pretty neat, I do feel like there would be place for the true graphical equivalent of ncurses; something both equally fast/lightweight, and as simple to code.
[1] https://www.fltk.org/doc-1.3/basics.html#basics_writing https://www.fltk.org/doc-1.3/basics.html#basics_writing
[2] https://www.fltk.org/doc-1.3/intro.html#intro_features https://www.fltk.org/doc-1.3/intro.html#intro_features
- ErotemeObelus 8y agoI think I discovered the problem with GUI libraries. They mix configuration with component logic.
- ScottFree 8y agoCan you elaborate?
- ErotemeObelus 8y agoYou have to specify a bunch of information regarding the width, height, color, positioning in the call of the function. There isn't anything analogous to css in programming languages so you're left with a big ball of mud. HTML+css is the easiest GUI toolkit to learn to date. It's so easy that young children in middle school are taught it in their web elective classes. And one reason it is so easy is because there is something like css.
- newen 8y agoI used this for a small project where I needed a quick GUI interface and it was great to use. I just made the GUI using FLUID and linked the buttons to my code. And I was able to compile it statically to all 3 OSes without too much trouble. Plus it's fast.