FE 'tkGooies' system
! Note !
More 'tkGooie' Tcl-Tk code samples may be added over time
--- and the script code presented here may be touched up
or replaced occasionally.
< Go to Table of Contents, below >
(SKIP THIS LONG INTRO)
In 2009, I finally 'took the plunge' and migrated my mail, bookmarks, etc. from a (main) Microsoft Windows machine to a (main) Linux machine. I have documented reasons why I went to Linux, along with install notes, on an Ubuntu Install notes page
I have described on the 'FE Nautilus Scripts' Description page of this site how I developed a system of Linux/Unix shell scripts to help me do many tasks --- including image processing, audio-file listening, movie (video/audio) file processing, file management, programming, computer system queries, and more.
Those 'FE Nautilus Scripts' shell scripts use a 'zenity' utility program to provide GUI prompts for user-input, when needed. However, some utilities (for example, various 'VIDEOtools') have a large number of possible input parameters.
In using the 'zenity' program for complex tools, one typically hits a point of having to make a choice between
Since I had about five-plus years of experience in using Tcl-Tk to make GUI prompting scripts during my pre-retirement years, I knew that I could use Tcl-Tk scripting in cases where I wanted to make GUI's that would avoid a long prompting sequence --- and, as a bonus, have seemingly unlimited capabilities in making the GUI's.
My first 'go' at making a system of Tcl-Tk GUI 'apps' began around 2010 with the creation of 'feHandyTools' as one of the FE (Freedom Environment) subsystems.
In that 'feHandyTools' system, I strived to make sure all GUI's had a 'common look', by using 'include' files (of Tk code) to assure that all the GUI's (the 'toolchest'-menus as well as the application-GUI's) used the same colors, fonts, geometry, etc.
However, around 2013 I came to the conclusion that it would be better to make a system of non-trivial Tk 'apps' that are scripts that can 'stand on their own'. That is, I decided to make this 'tkGooies' system using a different coding philosophy from the 'feHandyTools' system --- namely, the applications scripts would NOT use 'include' files of code. That way, each 'app' could be very easily implemented on its own --- NOT ONLY as part of the 'tkGooies' system.
One advantage of this approach is that I could develop the 'apps' in a stand-alone mode (as years go by), and easily integrate the 'apps' into the 'tkGooies' menu system as it became convenient or advisable.
Examples of the 'tkGooies' toolchest-menus :
The individual 'apps' of 'tkGooies' are presented via a toolchest-menu system like that which was developed for the 'feAppMenus' FE sub-system.
Here is the 'main menu' of 'tkGooies' --- as it was first released in March of 2015.
NOTE: In the next release, I will 'fold' some of these drawers
A click on any drawer of this main (top-level) 'toolchest' causes a 'category sub-toolchest' to appear --- such as the '3Dtools' toolchest.
To use any of the scripts (apps) in the 'tkGooies' groups (toolchests), the user can :
Below are examples of most of the sub-toolchests (menus) that are presented by clicking on the 'drawers' of the main 'toolchest'.
The grayed-out drawers indicate 'apps' that are on my to-do list for future releases.
(These toolchests will change somewhat in the next release
Besides my own scripts that I have donated to wiki.tcl.tk, I have collected many of the Tcl-Tk Wiki scripts that have inspired me, and I present them via a 'Wiki Demos' toolchest --- which offers sub-toolchests.
Here are some of those 'Wiki Demos' sub-toolchests. The 'wiki-numbers' correspond to pages on the wiki.tcl.tk site. You can go to those pages to see the text that was offered with the original code contribution.
The 'Games' are not really 'demos'. They actually do 'game work'.
Planned Reorganization of the toolchests :
I plan to reorganize these toolchests in the next release.
For example, in the 'Front Ends' toolchest, there is a mixture of 'apps' that I will break up into 'AUDIOtools', VIDEOtools', and 'SYSTEMtools' toolchests --- quite similar to the menu structure that I used in the 'feNautilusScripts' menu cascade.
For the next release, I plan to reorganize the 'drawers' of the main toolchest to look more like the following (some sub-menus are shown indented) :
This would put about 14 'sub-toolchest' drawers on the main menu --- plus a 'MORE' category, which is intended, like in 'feNautilusScripts', to allow access to a menu of additional, less-used categories of 'tkGooie' scripts.
Like with the 'FE Nautilus Scripts' system, I expect the number of categories in the 'tkGooies' system to grow to between 30 and 40 categories --- counting sub-categories.
The Code Samples :
To make the code of many of the 'stand-alone' Tk scripts of the 'tkGooies' system available for perusal in these pages, I decided to provide many of the code samples on HTML pages that are a reformatting of my donation-pages at wiki.tcl.tk.
There are some 'moderators' of the wiki.tcl.tk pages (in particular, Nathan Coulter, who hides behind the monicker 'Poor Yorick' and initials PYK --- and Richard Ellis, who uses the initials RLE) who are, at times, obsessive-compulsive in their editing of the wiki. In particular, Coulter has taken the liberty of changing my pages in ways that I do not approve of.
In addition, Coulter has devised and run 'batch' scripts against the pages of the wiki. Some of those scripts made changes that caused some peoples' script donations to not work anymore.
I cannot be wasting my time trying to make sure that my 60-plus donations to wiki.tcl.tk are still runnable, as they were when I donated them.
Nathan Coulter is on the board of the Tcl Community Association. In spite of that position of responsibility, he has had a long-running sequence of 'run-ins' with contributors on the Tcl-Tk Wiki about changing their contributions in ways that really irk them. He has driven multiple people to distraction. No wonder he hides behind the name 'Poor Yorick' and initials PYK --- as much as possible.
These HTML pages allow me to present my code in a way that is immune from Coulter's unilateral changes. So my original wiki.tcl.tk contributions are available here --- no doubt with some typos and poor wording --- warts and all.
To cut this story short --- code samples of scripts in groups of 'tkGooie' scripts are accessible via the Table of Contents, below.
More will be coming --- as indicated on a 'tkGooies' To-Do List (roughly in 'future chronological' order).
These code samples vs. the packaged code
I do not guarantee that the code images, presented on these 'tkGooies' CODE web pages, will always be exactly in sync with the scripts in the latest self-extracting install script on the FE 'tkGooies' download page.
I may not always update these code samples when code is revised (improved) and put in a release package.
On the other hand, there may be some code samples in these code samples pages that have not yet made it into the next release of 'tkGooies'.
'tkGooies' code release procedure
When I make a 'first release' of a new 'tkGooie' script, I will probably
Occasionally, the code in the most recent 'tkGooies' install file may be more up-to-date than the code samples in these 'tkGooies' CODE web pages.
In any case, when a script appears in a new release of the 'tkGooies' system, the script code may be available in 2 places:
There could be some differences in the two 'public' versions of a 'tkGooie' script --- especially over time, as updates may be made to one copy but not the other.
In addition, I may post some of these scripts on a wiki.tcl.tk page --- so the code of a 'tkGooie' may be available in three 'public' places (and the 3 copies may be slightly different over time).
The table of contents below provides links to separate web pages that show the source code of 'tkGooies' 'apps'. The source code is Tk script code, with some of the Tk scripts calling shell scripts (whose code is also presented).
Table of Contents:
(links to pages of description & code of Tk GUI scripts)
Some notes on presentation of these scripts are below.
End of Table of Contents. See the warning notes below.
How the code samples are presented on the FE 'tkGooie' Scripts CODE pages
Each of the 'tkGooie'-script code samples is presented as a link to a '.txt' text file. Click on the link and you can browse the text in your web browser. And you can right-click on the link to use an option such as 'Save Link Target As ...' to save the script code in a local file on your computer.
Generally, in the scripts, I use double-# (##) to indicate a true comment. That is, it is not an executable statement and should never be de-commented.
I use single-# (#) to indicate an executable statement that has been commented. Typically this is because I might want to decomment the statement when doing testing of the script in a terminal window. Generally, the statement should be re-commented --- or a neighboring statement should be commented --- when finished testing.
I do not try to make one-liner scripts, nor do I try for the absolute ultimate in processing efficiency. (But I am aware of several things to avoid that would make scripts run as slow as molasses.) I try to make the scripts readable (to me). At the same time, they generally execute quite rapidly, even, for example, in a file-manager 'app' that shows filenames in a directory containing more than a thousand files. Some of these scripts can be MAJOR time savers.
To see each listing of a script, use the 'list of code-links' on each of these 'group of FE tkGooie Scripts' web pages. Simply scroll down the 'group-of-scripts' page to spot script-names of interest.
Alternatively, use the 'Find text' option of your web browser to look for keywords on the 'group-of-scripts' page. For example, on the 'IMAGEtools' page, when looking for examples of scripts that do image 'warping' or 'merging' or 'morphing', use a FindText keyword like 'warp' or 'merg' or 'morph'.
Shell script considerations :
Some of these 'tkGooie' Tk scripts call on 'shell scripts' that were written so that they can run via the Bourne or the Korn shells (command interpreters), as well as via the Bash command interpreter.
Most of those shell scripts employ Linux/Unix commands (and their parameters) available to all three shell interpreters, so the scripts will generally run in any of these three interpreters.
In fact, the Korn and Bash interpreters are offshoots of the Bourne command interpreter.
Input-File-Safety and Disclaimers :
Most of the 'tkGooie' scripts do not change any files selected by the user. Like in the 'feNautilusScripts', when a 'tkGooie' script accepts a file (or files) as input, the 'tkGooie' script will generally put any output generated in a new file (or files). Hence, there is no harm to be done to the original file(s). You can examine the code, to erase doubt.
The code is presented here mostly for my own personal use --- for example, as a programming reference (from different computers, at home or away) --- and as a means of organized archival and backup. I may use portions of the scripts for working code fragments to be applied in other scripts.
If other people use these scripts, they should test them on test data before using in a 'serious' mode. In other words, test your assumptions about what any one of these scripts can do.
Be forewarned that many of these scripts ('apps') have some limitations in their capabilities. For example, if I provide a converter of ASCII 3D model files among various formats, the converter will probably support only certain kinds of data within the model files (points, lines, polygons, for example --- but not texture mappings).
Since these 'apps' are 'free', you cannot expect 'professional level' capabilities. On the other hand, you may be surprised at the capabilities that some of the scripts have --- especially with a little 'tweaking' or enhancement.
You can look for other Tcl-Tk scripts via a web search on keywords like 'tcl tk scripts button'. You may wish to change the 'button' keyword or add keywords such as 'frame' or 'widget' or 'pack' or 'binding' or 'image processing' or 'canvas' or whatever --- to look for specific kinds of Tcl-Tk scripts.
Probably the best resource for Tcl-Tk scripts that are not just 'snippets' is the Tcler's wiki at wiki.tcl.tk. You can use the 'Search' entry field on the left side of the wiki pages to look for Tcl and/or Tk script code that may answer your particular question.
There do not seem to be many people who have taken the time to put together a collection of many, non-trivial Tcl-Tk GUI scripts, but here is one (old, circa 2010) attempt at starting a Tcl-Tk scripts collection at subdude-site.com --- in categories such as:
Other than the wiki.tcl.tk web site --- and this 'Freedom Environment' site, I have not seen a site yet that offered 60-plus, non-trivial Tk-GUI scripts.
A majority of the Tk scripts at the wiki.tcl.tk web site are 'demo' scripts that were written to demonstrate a Tcl/Tk programming principle, rather than to provide a 'robust, end-user utility'.
Some other places where Tcl-Tk is used (mostly post-2014) :
There are hundreds of Tcl or Tcl-Tk scripts --- for various 'tasks' --- at rosettacode.org --- but most of those scripts are small 'demo' scripts, like those at wiki.tcl.tk, and many can also be found on wiki.tcl.tk.
There are lots of Tcl and Tcl-Tk code 'snippets' (examples from training material) at wellho.net (in 2015). While that site can be helpful to those seeking answers to Tcl-Tk coding questions, there do not seem to be any 'robust, end-user utilities' at that site.
Electronic Design Automation
Tcl-Tk has been used for decades in the EDA (Electronic Design Automation) industry.
From 'doulos.com': "Every user of EDA tools ... needs to know about Tcl." The Doulos company offers Tcl-Tk training and some example Tcl-Tk scripts, for EDA.
In particular, 'doulos.com' offers training in using Tcl to control the EDA software ISE design-ware from the company Xilinx. "Almost every industry-leading EDA tool uses it [Tcl] to provide a powerful and platform-independent command language." (circa 2008 quote)
A 2014 paper noted that Tcl has been the foundation of the scripting interface of the biomolecular visualization and analysis program VMD (from University of Illinois at Urbana-Champaign) since 1995 --- and the interface was extended to the parallel molecular dynamics program NAMD in 1999. VMD and NAMD have over 200,000 users "who have enjoyed for nearly two decades the stability and flexibility provided by Tcl".
Astronomy and Astrophysics
This old (year 2000) Lick Observatory page gives an idea of how Tcl-Tk GUI's are used in astronomy applications. (UCO = University of California Observatories)
As another example of Tcl-Tk usage in astronomy, here is a year 2000 paper on Tcl/Tk Extensions for Astronomy (from the Smithsonian Astrophysical Observatory = SAO, of Cambridge, MA), which points out:
"When designing SAOTk and TclXPA, it was decided that no alterations of Tcl/Tk should be necessary. These packages use the existing Tcl/Tk API. The SAOTk widgets are implemented as Tk Canvas widgets because the latter provides support for both image data and line graphics, flexible layout management and event processing. The TclXPA package is implemented as Tcl commands."
Even more Tcl-Tk 'apps' in astronomy:
Tcl-Tk is also used in control software at the European Southern Observatory sites (Chile, Germany, UK).
Debian Astro Pure Blend contains about 239 packages for astronomy applications, including a group of Tcl/Tk packages.
Mechanical and Fluid Dynamics Engineering
Altair - Hypermesh
Tcl was being used in 2014 with Altair Hypermesh software for CAE (Computer Aided Engineering) design automation, such as FEA (Finite Element Analysis).
There is some extensive help on writing Tcl-Tk scripts for Altair software at www.sharcnet.ca.
Pointwise - Gridgen
Around 2012, a web page said that Gridgen's Tcl-based scripting language, Glyph, provides customization capabilities for both the experienced analyst and the "design engineer" [3D draftsman]. The 'Pointwise' software continued to use Glyph and provided a Glyph Script Exchange.
Glyph scripts may also be available via this github.com link.
It was said that:
ANSYS - FEA
In doing a search on 'ansys tcl tk' or 'fea tcl tk' around 2013, I found an 'fea-ansys-tcl-tk-jobs' page at GE (General Electric). It showed lots of jobs with no mention of Tcl-Tk. (??)
That page was gone in 2016, but the link above took me to a GE Careers search page. I entered 'tcl tk' in the search field. It showed me 3 job openings that menioned Tcl-Tk --- all three in India. Anyway ...
ANSYS is an FEA (Finite Element Analysis) program used by mechanical engineers. ANSYS has used Tcl-Tk as a scripting and user-interface language --- as indicated by this 13-slide presentation in a PDF file.
NX - FEA
NX is a finite element analysis system owned by Siemens (Germany) in 2016 --- acquired from UG (Unigraphics) (St. Louis) around 2007 --- and before that, developed as part of the I-DEAS software which was acquired by Unigraphics around 2001 from SDRC (Structural Dynamics Research Corporation) of Ohio.
Tcl-Tk can be used for post-processing of NX results by using SmartDO (Smart Design Optimization) software.
GEOVIA Minex (mining software) uses Tcl and Tk to automate tasks. After you have created the scripts (or had them created by GEOVIA), you can run them repeatedly to perform repetitive tasks at a single click. Tk can be used to create a user interface, which runs on top of Minex. "GEOVIA, known as Gemcom Software prior to its acquisition in 2012, is part of Dassault Systems, the 3DEXPERIENCE Company. While GEOVIA's focus is currently on the mining industry, its objective is to model and simulate our planet, ..."
The AndroWish wish-interpreter allows one "to run desktop Tcl and Tk programs almost unaltered on the Android Platform, while it opens the door to script a rich set of features on a mobile platform." Since AndroWish only started in 2014, there is probably much more news coming from this 'front' in 2016 and beyond. Example scripts are packaged with the AndroWish interpreter.
This Who Uses Tcl? page at wiki.tcl.tk lists many more companies and organizations that use Tcl-Tk.
But I digress. Back on topic (providing MANY 'robust, end-user Tcl-Tk utilities') ...
This freedomenv.com site is the only site that I know of (up to 2016 October) that is trying to provide 'many, many, robust, end-user Tcl-Tk utilities' --- in a wide range of application areas --- along with comments in the code that are intended to help others to write such utilities using Tcl-Tk. :-)
Hopefully, by 2019 or 2020, 'tkGooies' will provide more than 200 mini-'apps' and not-so-mini-'apps' --- in an integrated system of 'toolchests'.
FE 'tkGooies' . . . . Lots of GUI Hammers for Your Various Nails.
Bottom of the
The code samples in the category pages provide Tcl-Tk scripting beginners (and some experienced developers) examples of Tcl-Tk code that use techniques, command-line tools, and options that they may not be experienced in using. Hence these are development time-savers.
To return to a previously visited web page, click on the
Back button of your web browser a sufficient number of times.
OR, use the History-list option of your web browser.
Page was created 2014 May 02.