Comment by sprash
8 days ago
Tcl/Tk to this day is the best tool to make GUI frontends for CLI applications. Besides that, in the past I used it in production for intranet database entry applications. It has since been replaced by Flask. In my opinion the higher complexity of the Flask version is no way justified and we should have kept the much simpler ~2k LOC Tcl/Tk solution.
In the 1990s, entire GUI applications would be written in Tcl/Tk -- not just the frontend -- the entire thing.
>Tcl/Tk to this day is the best tool to make GUI frontends for CLI applications.
Why? Please elaborate. I've heard others say this, but would like to know more.
>Besides that, in the past I used it in production for intranet database entry applications.
GUI apps?
> Why?
CLI applications typically read text from stdin and write text to stdout. The tcl model of "everything is a string" makes exactly the right abstraction to create GUI frontends for CLI applications rapidly and keep them simple at the same time.
> Why? Please elaborate.
Tk's GUI object model is sitting at a reasonable maxima between trivial to make use of vs. triggering the events necessary to make the GUI active.
Small example. You want a button on your GUI that triggers a procedure called "process" when it is clicked, this is the code you need (if you are fine with the remaining defaults) (and assuming you used 'pack' as the geometry manager):
And a fully active GUI button will now appear at the bottom of your Tk window, with a label of "Process Entries" and when you click it, a Tcl procedure named "process" will be executed.
What is the best and easiest to install binary distribution?
I was looking into this for v9 and gave up on finding a binary which was:
- easily found
- agreed upon as the one to use
- available for and easy to install on all three platforms
Should I look again?
https://github.com/teclabat/tcltk-binaries
For jimtcl (the production-ready minimalistic tcl implementation which antires started (with full closures & gc'able lambdas) - probably an outgrowth of picol), you can get static "(some) batteries included" binaries at:
https://github.com/dbohdan/jimsh-static
For full tcl with the kitchen sink, bathtub & shower included, for android (hence the name) & regular Linux:
https://androwish.org/home/home