This is the Linux Tcl and Tk HOWTO. It is intended as a Linux reference covering everything you should know concerning installation, configuration and an introduction to development under Tcl and Tk. History and some pros and cons about Tcl and Tk under Linux are analized, and references are given to many other sources of information on a variety of topics related to this simple but powerful scripting language.
If you ever rebuilt your Linux kernel inside X using the command
you surely managed to face the strenght of this simple but powerful scripting language.
After executing the first step of kernel rebuilding, a script called kconfig.tk is executed via wish (the Tcl intepreter). The Linux Kernel Configuration wind ow appears. Instead of answering a series of questions, this X-based configuratio n utility allows you to use checkboxes to select which kernel options you want to enable.
The system stores your last configuration options so that every time you run it, you need only to add or remove some checks and you don't need to reent er the whole set of option. Moreover you can fill the whole (or part of the) list of kernel option the order you want. After this simplified step you can rebuil d your kernel in the traditional way.
There's actually another famous case. Have you ever used "printtool" ? (Printer Config Tool (C) Copyright 1994 by Red Hat Software - author: Michael Callahan). If you installed a Red Hat distribution you happily managed to use it to set up printing services . Well, printtool front-end is mainly a Tcl/Tk script.
For those who don't know Red Hat let me tell you how you can easily configure your printers just filling some textboxes and filling in some checkboxes.
The program itself takes care of setting up printing services through the creation of spooling directory, writes /etc/printcap file and the printer's filter, reloads lpd and tests your filter with ascii or postscript pages. It allows you manipulate ghostscript options (i.e. choose up to 8 pages per outpu t page and setting margins), has an help-on-line and many more features.
What is the difference compared to other service-printing implementation?
Everything is achieved by using Tcl/Tk as a "glue" between consolidated application and operating with normal Linux configuration files in a visual and interactive window under X-Window. No new application-specific commands were written at all.
Currently the purpose of the document is limited to giving initial references to Linux users; in future versions I will try to incorporate a small "Programm ing Tutorial". Let me state that again: this is not (and doesn't want to substitute) an omnicomprehensive "user manual" or "reference" for Tcl and Tk development and programming - it's just a starting point for Linux users.
The author's concept of reference manual coincides with the definition of man pages and many people learn Tcl/Tk from these basic source of informati on. These files are a part of the source code distribution and are installed on your Linux box. You will be able to access the Tcl/Tk manual pages through the man command.
Many structured and complete programming tutorials have been written in order to let the new user begin hacking with Tcl/Tk; tons of other material are available in the Internet. Interpreting Tcl/Tk philosophy I won't try to reinvent the wheel, I will manage to glue the huge amount of material already available.
I suggest you to have a look at the other documents listed in the References section in order to find where to retri eve specific information about Tcl and Tk.
In order to understand the abc of Tcl/Tk you shouldn't be a programming-guru, command sintax is very simple. Basically you have to be familiar with:
Newer versions of this document will be uploaded to ftp site: ftp://sunsite.unc.edu/ pub/Linux/HOWTO/ and will be available on all other mirrors.
Hypertext and other versions of this and other Linux HOWTOs are available mainly at sunsite.unc.edu/LDP/lpd.ht ml and www.linux-howto.com and on many other Mirror World-Wide-Web sites.
I will try to incorporate in my Web-Page the most recent html and sgml version of the document. Most Linux CD-ROM distributions include the HOWTOs, often in a subdir of /usr/doc/ directory, and you can also buy printed copies from several vendors.
Sometimes the HOWTOs available from CD-ROM vendors, ftp sites, and in hardcopy format are out of date. If the date on this HOWTO is more than six months in the past, then a newer copy is probably available on the Internet.
If you make a translation of this document into another language, drop me a line and I'll include a reference to it here.
I rely on you, the reader, to make this HOWTO useful. If you have any suggestio ns, corrections, or comments, please send them to me, ( ), and I will try to put them in the next revision.
If any of the links mentioned in this document becomes unavailable or changes, please notify me immediately so that I can update and/or remove the link.
I am willing to answer general questions about Tcl/Tk and Linux as best as I can. Before doing so, please read all of the information in this HOWTO, and send me detailed information about the problem.
If you publish this document on a CD-ROM or in hardcopy form, a complimentary copy would be really appreciated. E-mail me and I will send you back my postal address.
In many section I mention publishing companies or commercial URL sites: I really don't work for these guys.
Most of the information in this HOWTO comes from Dr. Ousterhout's Scriptics and Larry W. Virden comp.lang.tcl FAQs .
I would like to thank the PLUTO Italian Linux User Group and the whole volunteers of ILDP (Italian Linux Document ation Project) especially Eugenia Franzoni and Giovanni Bortolozzo for their feedbac k.
This document is Copyright 1998 by .
This document is distributed in the hope that it will be useful to the reader: of course it is considered to be without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. This HOWTO is free documentation; you can redistribute it and/or modify it under the terms of the LDP COPYRIGHT .
Please read the LDP Manifesto for more details.