FE 'tkGooies' system
A 'tkGooie' for making edge-shaded,
! 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)
INTRODUCTION to the 'tkGooies' system:
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
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.
(Only the toolchests will use the 'include' code --- to assure that the toolchests have a common 'look and feel'.)
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.
Other planned changes are
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 after the initial 2015 March release of 'tkGooies'.)
This 'FrontEnds' toolchest will be split into
'VIDEOtools', 'AUDIOtools', and 'SYSTEMtools' chests
in the next release.
The 'IMAGEcreatorsFlat' & 'IMAGEcreatorsShaded3D'
menus will be accessed via drawers in this
'IMAGEtools' toolchest, in the next release.
This 'Meters' menu will become the
'SYSTEMtools' menu in the next release.
This 'Network Tools' menu will become
the 'INTERNETtools' menu in the next release.
MATHed (education) toolchest
The 'MATHed' menu above and the 'ODEtools' menu below
will be accessed via drawers in this 'MATHtools' toolchest,
in the next release.
(I had not coded any ODE 'tkGooies' as of 2015 March.)
(Finishing these grayed-out 'PLOTtools'
is pretty high on my 'to-do' list.)
Besides my own scripts that I have donated
to the Tcler's wiki at 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 (sample image below) ---
which offers sub-toolchests of GUI demos.
Below are some of the '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 each
original code contribution.
The 'Games' are not really 'demos'.
They actually do 'game work'.
Wiki GAMES toolchest
I have never hit a bug in trying these games.
(Admittedly, I have not 'exercised' them extensively.)
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 --- starting with a reformatting of my code-donation pages at wiki.tcl.tk.
In fact, I was strongly motivated to start these 'tkGooie' pages by some 'disconcerting' things happening at wiki.tcl.tk. I could no longer count on that site being a good place to publish my code donations.
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.
Even worse, 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.
Coulter has driven multiple people to distraction ---luring them into long, counter-productive, living-in-your-head 'discussions'.
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.
I will be trying to improve the wording on these pages, as I re-visit them. And I may update some previously contributed code --- and add new information and web links to these pages.
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.
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.
I may post some of these scripts on a Tclers' Wiki 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:
(Each of these links is to a menu-page of links.
Some notes on presentation of these scripts are below.
Tcl-Tk Programming aids:
Sources and To-Do Lists:
End of Table of Contents.
How the code samples are presented on
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 'tkGooie' scripts have --- especially with a little 'tweaking' or enhancement.
Sources of Tcl-Tk code:
You can look for other Tcl-Tk scripts via a web search on keywords such as 'tcl tk script 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 a 'Search' option of the Tclers' 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 Tclers' Wiki 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 Tclers' Wiki web site are 'demo' scripts that were written to demonstrate a Tcl/Tk programming principle, rather than to provide a 'robust, end-user utility'.
But most of those scripts are small 'demo' scripts, like those at the Tclers' Wiki, and many can also be found on the Tclers' Wiki.
There are lots of Tcl and Tcl-Tk code 'snippets' (examples from training material) at wellho.net (in 2015).
While the wellho.net 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.
Some places (esp. companies) where Tcl-Tk is used
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.
"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.
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:
Here is a 2001 paper on Tcl/Tk Applications at the Hat Creek Radio Astronomy Observatory in Hat Creek, California.
And here is a 1997 paper on Tcl-based Applications at the U.S. Naval Observatory.
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:
"The experienced analyst will find that Glyph's commands cover the entire range of functionality available in Gridgen's GUI, allowing tricks and special techniques to be captured and made part of the organization's intellectual property.
Designing engineers will appreciate the fact that Glyph may be used to create customized meshing applications for specific configurations, allowing them to automatically generate a mesh and apply CFD (Computational Fluid Dynamics) analysis."
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.
A quote from them:
"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 the Tclers' Wiki 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 2019 June) 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 the end of 2020 or 2021, '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 this Menu page of
The code samples in these 'tkGooie' category pages provide to Tcl-Tk scripting beginners (and some experienced developers) examples of Tcl-Tk code that use Tcl-Tk techniques, Tk code parameters, and shell script options that they may not be experienced in using.
These complete (runnable-code) scripts 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.