Purpose
Document various useful online or interactive Tcl and Tk tutorials..The official Tcl tutorial is discussed at tcltutorial. Since this tutorial is free software under the same generous license as Tcl itself, you are welcome to help improve it, translate it, publish it, or do whatever else you would like.Comments and suggestions on the contents from both new and experience users are very welcome.SYStems How can we comment? I suggest a comment sections beneath each lesson. It will act like slashdot story comments, sometimes you can learn more from the comments than from the story. Actually this way the lesson itself can be very basic, and all the gotchas can appear in the users comments.davidw You can comment just as you would with any other aspect of Tcl - via the tcl-core mailing list, or via the SF bug/request trackers. An on-line version with comments might be kind of neat, but I'm unlikely to spend time building that myself. I want something that can be shipped as-is with the core. So if there are things that need fixing/improving, let's do it.LV Question: has anyone examined the tutorial to determine how much of the tcl scripting level language has been covered and how much remains to be covered?NEM No. It's something I plan to do when I have more time, which should be after Christmas 2008.LV another item of note - the above official tutorial is currently just for Tcl. If someone is looking for a useful contribution, writing similar tutorials for Tk, as well as other popular extensions, would be a wonderful thing to give back to the community.Hopefully, you will be able to work with the others so that all the tutorials could end up in the same location, providing an evolving community electronic tcl book of sorts.Take a look at Mark Roseman's http://www.tkdocs.com/ as a great set of documents. Perhaps this will inspire some writers into writing a gentle introduction to Tk.
Of course, just because there are plans to ship a tutorial with the Tcl core should not discourage anyone from writing their own tutorials. There are many ways to learn, and having many tutorials provides people with choices. As long as the information is correct, having choices is a good thing.background navyblue;
English, General purpose
- Tcl Tutor, an interactive tutorial for learning Tcl (recent versions cover only Tcl, not Tk)
- Salvatore Sanfilippo is writing Tclwise, the first chapters are available online at http://www.invece.org/tclwise/index.html - RS highly recommends this - when reading it, I more than once thought, "wish I had written that myself..." :)
- http://www.bin-co.com/tcl/tutorial/ is a tutorial for Tcl/tk beginners. The Tk part begins here [1].
- http://www.purl.org/NET/Tcl-FAQ/ has a variety of pointers to tutorials.
- http://www.tcl.tk/ has a variety of white papers and pointers of a tutorial nature.
- Roy Terry recommends a particularly experimental trajectory [2].
- http://www.phaseit.net/claird/comp.lang.tcl/tcl_tutorials.html contains pointers to a varity of tutorials.
- A series of PostScript slides used in an introduction/tutorial on Tcl and Tk at several X and Usenix Conferences are available as ftp://www.tcl.tk/pub/tcl/doc/tut.tar.Z .
- A Tcl/Tk and Expect tutorial paper by mailto:will@Starbase.NeoSoft.com can be found at ftp://ftp.lgc.com/landmark/users/papers/WMorse/wmorse.tcltk .
- iCanProgram.com has been running free online (beginner level) programming courses using Tcl/Tk as a programming language. For more info consult http://www.icanprogram.com/ . For instance, see http://www.icanprogram.com/09tk/main.html .
- A short Tcl & Tk tutorial by Alex Samonte can be found at http://www.csc.calpoly.edu/%7Edbutler/tutorials/winter96/tcl/ .
- At http://www.cs.tamu.edu/people/mmiller/tcl/ is a Tcl 8.0 tutorial based on John Ousterhout's original tutorials, as well as Tcl UDP and a disk usage application. The creator also has some online doc for Tcl UPD and Tcl channels at http://www.cs.tamu.edu/people/mmiller/tcl/channel.html
- The http://photo.net/ site is filled with interesting information for the Tcl programmer. For instance, http://photo.net/sql/ appears to be a working draft of a book initially called "SQL for Web Nerds". It is a tutorial on SQL, using the AOLserver as a base and Tcl as the programming language. There are other items such as http://photo.net/wtr/dead-trees/ , which is the web version of the book "Database Backed Web Sites". Then there is the ArsDigita Community System, a database driven web forum.
- George Peter Staplin GPS has written some tutorials on how he uses movies, audio, images and PNG cursors with Tcl/Tk in a game he is writing. See [3]. Broken link 2006-01-21.
- IBM has a beginners' web-based tutorial: http://www-106.ibm.com/developerworks/education/r-tcl.html?n-l-10181 . This introduction is not fully up-to-date, and has enough questions and errors that one might hesitate to point newbies to it. ***NOTE*** This tutorial has proven to be less then ideal (written by a non-Tcl type), so this one should be last on your list of sites to learn about Tcl.
- While recently I was unable to get to the above URL, this one seems to work: http://www-106.ibm.com/developerworks/edu/l-dw-linuxtcl-i.html?S_TACT=103AMW03&S_CMP=EDU
- See also http://www.swen.uwaterloo.ca/~dasiewic/courses/ece452/local/old_tuts/trudeau-tck-intro.pdf
- http://www.ibiblio.org/pub/Linux/docs/HOWTO/TclTk-HOWTO is a rather old document oriented towards Tcl/Tk 8.0 - perhaps one of the Linux users here on the wiki would consider updating http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/docbook/TclTk-HOWTO.sgml.gz and then submit the changes back to ibiblio.org ?
- http://hegel.ittc.ukans.edu/topics/tcltk/index.html - have put together a very good tutorial covering the basics of TCL. The tutorial itself begins at http://hegel.ittc.ukans.edu/topics/tcltk/tutorial-plugin/index.html
- http://pages.cpsc.ucalgary.ca/~saul/personal/archives/Tcl-Tk_stuff/tcl_examples/ - Some examples of TK widgets.
- http://www.pconline.com/~erc/tcl.htm "Graphical applications with TCL/TK" includes some great examples of laying out large apps.
- http://www.lib.uchicago.edu/keith/tcl-course is an old web site with a variety of pages covering various Tcl topics.
- Michael Norton's Elementary Computer Graphics article is a Tcl tutorial - http://www.oreillynet.com/pub/a/mac/2003/12/16/begin_programming.html
- Wikibooks has a complete and free Tcl/Tk book/tutorial with nice examples: http://en.wikibooks.org/wiki/Tcl_Programming
Tk Tutorials
- An excellent tutorial on Tk & ttk: http://www.tkdocs.com/tutorial/index.html . Covers Perl, Ruby and (soon) Python language bindings to Tk, as well as Tcl.
Tcl Web/CGI/HTML Tutorials
- BOOK Tcl for Web Nerds is an online book/tutorial. CL advises regarding updates of this resource: "Not recently. FAR from recently. And its culture is quite different from what most Web beginners in 2008 expect. It's the best suggestion I know, though."
Other languages
- A French tutorial on Tcl can be found at http://freealter.com/fr/ProjetsLibres/tcltk/ (there also used to be one at http://www.loria.fr/moyens-info/logiciels/tcltk/ . Apparently it has expired).
- Another French tutorial on Tcl 8.4 can be found at http://perso.wanadoo.fr/maurice.ulis/tcl/IntroductionTcl8.4.pdf (PDF)
- A French tutorial can be found at http://www.lisi.ensma.fr/ftp/pub/documents/papers/1999/copyrighted/1999-msr-grolleau.pdf
- A French translation of the official tutorial can be found at [4] under the name "Cours de Tcl".
- Polish Tcl/Tk tutorial can be found at http://sqlitestudio.one.pl/tcltut/
- A WWW resource for what appears to be a German introduction/tutorial on Tcl and Tk is at http://www.tu-chemnitz.de/home/stb/tcl_tk/tcl_tk.html - MEd 2006/03/09: Site does not seem to exist any more
- A German Tutorial (Tcl only, no Tk) is available in PDF format at https://www.bg.bib.de/portale/bes/pdf/Einfuehrung_Tcl.pdf
For non-programmers
- Teach programming to children, of course.
- "A Non-Programmer's Introduction to Tcl/Tk" [5] is stuck with pre-2005 practices--but the basics have changed little since then.
- http://tcl.projectforum.com/young is a work in progress providing a tutorial for young people.
- Alan Gauld's online tutorial "Learning to program" IS aimed at non-programmers. While the principle illustration language is Python, he also gives examples in Tcl (included with Python distributions) and Basic. See http://www.freenetpages.co.uk/hp/alan.gauld/ for the tutorial.
Specialized/Advanced
- An HTML version of the TclCommandWriting man page that comes with TclX has been made available on the WWW at http://psg.com/~joem/tcl/CmdWrite.html . This page explains the C API to Tcl, providing an introduction/tutorial on writing Tcl extensions.
- A tutorial on the option database can be found at http://www.cs.man.ac.uk/~fellowsd/tcl/option-tutorial.html
- Captain Crumb explains canvases, with a focus on animation, in [6].
- Mark Roseman has contributed a tutorial [7] on Metakit for Tcl developers.
Other related pages on this wiki
- The pages on Expect, TclXML, ... refer to several tutorials.
- Teach programming to children, again.
- Tcl Articles is a page here on the Tcler's Wiki that points to various articles in the printed and electronic press. These frequently provide tutorial level information.
- Online tutorials
The point in providing one official tutorial is not to quash others efforts, but to provide a focal point for tutorial work in order to raise the bar some. It would be preferable to have one good freely available tutorial that is maintained rather than lots of stuff like the IBM one that apparently isn't that great. Other tutorials will then have to differentiate themselves in some way - more focus on beginners, on experts... they will have to adapt and improve.There are also times when choice is not good. Tutorials for most people are something where they'd like to find one that's good, rather than 10 mediocre ones that all purport to teach the same material. Were it up to me I'd prune the above list to eliminate some of the older links that don't really have anything new or different, and then I would categorize the other tutorials.- davidwLV While certainly having one good tutorial is better than having 10 mediocre - having 10 great tutorials is much better than having one good one. For those of you who would rather contribute to making the tutorial (that exists on the same web site as Tcl 8.5) better, please submit your suggestions for improvement. Having online docs for Tcl be the best possible is a great idea.
RLH - example code. That would be one of the better things to have in the docs that ship with 8.5. Sometimes as a newbie to Tcl I don't quite grok the syntax but an example clears that right up.LV Example code is a great thing to have. Good example code - best practice quality - is even better. Don't show code that, if someone comes around using, the response would be but no one would code it that way.DBP Also, I keep seeing reference to the "dozen rules"...but can't find a page that tells the dozen rules! A nice little page saying what the dozen syntax rules are, with illustrations of each, would be very helpful for a newcomer like me. Especially if you link it from the "dozen rules" sentence on the homepage...RLH I think this gives the 12 rules of Tcl 8.5: http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htmLars H: Here on the wiki that dozen is often known under the fancier name "the dodekalogue".
AM (10 june 2005) Now that the Tcl tutorial is well on its way, I thought it a good moment to contemplate the Setup of a Tk tutorial
RLH 2006-01-08: A few of the links above are dead or have information that no longer applies to Tcl. Should a person remove these to help in cleaning up the wiki?NEM Yes, please do. The links are still available via the revision history if someone disagrees about a particular link.LV It would be preferable before deleting the links to confirm, if at all possible, with the site that the resource is gone, and not just moved or possibly off line temporarily. Also, before deleting, see perhaps if you can change the link to go through the archives at http://www.archive.org/ to find the resource.
"A Tutorial Introduction to Tcl and Tk"LV So, where do we find this introduction? Is this a reference to [8]?
Anyone know of any online tutorials that cover using Tcl as the language to do web development? There is http://philip.greenspun.com/tcl/index.adp - Tcl for Web Nerds - which teaching an intro to Tcl using AOLServer as the web engine. After you complete this brief intro, there's a couple other tutorials mentioned in the summary that lead the reader along the path of learning more about AOLServer and Tcl and web development. http://tcl.apache.org/websh/examples.ws3 is another, older, tutorial.