Quick
index
main
eev
eepitch
maths
angg
blogme
dednat6
littlelangs
PURO
(C2,C3,C4,
 λ,ES,
 GA,MD,
 Caepro,
 textos,
 Chapa 1)

emacs
lua
(la)tex
maxima
 qdraw
git
lean4
agda
forth
squeak
icon
tcl
tikz
fvwm
debian
irc
contact

Edrx's Tcl/Tk Page

(This page is being rewritten!)

Long story short: Tcl was one of my favorite languages in the 90s. I used Expect a lot, and one of my main ways of controlling external programs from Emacs used an Expect script to control xterms; I used Tcl to generate my HTML pages; I wrote this library in Tcl/Tk to generate the diagrams in my MsC thesis; and in 2000 I made a Debian package of mktclapp, and applied to become a Debian maintainer - but it didn't work... then I fell in love with Lua, and:

  • I wrote this HTML generator in Lua, and switched to it,
  • I wrote this to generate LaTeX diagrams, and switched to it,
  • I wrote eepitch to control external programs from Emacs, and switched to it...


1. Tcl/Tk and eepitch

Eepitch-ing Tcl is trivial. Try:

* (eepitch-tclsh)
* (eepitch-kill)
* (eepitch-tclsh)
puts [expr 1+2]

The obvious way to use eepitch on Tcl/Tk scripts is to use eepitch-wish instead of eepitch-tclsh... but I don't like that, because that creates a Tk window over the Emacs window. Here is a workaround:

* (ee-set-fullscreen nil)
* (size 150 56)
* (eepitch-tclsh)
* (eepitch-kill)
* (eepitch-tclsh)
package-require-Tk

It makes Emacs switch to non-fullscreen mode, resizes the Emacs window to the "right" size, runs tclsh instead of wish, and calls package-require-Tk, that is defined in my .tclshrc; package-require-Tk tells Tk to open its toplevel window in a place that doesn't overlap the Emacs window - as in this screenshot:

Test blocks in Tcl scripts are a bit hacky (and fragile). If we run M-x eeit in a file foo.tcl it inserts a block like this:

lindex {{} {This is a test block:
* (eepitch-tclsh)
* (eepitch-kill)
* (eepitch-tclsh)
  source foo.tcl

}} 0 ;# End of the test block


2. Diaglib - a Tcl library for creating and editing diagrams

Back in '99, when I needed to draw some category theory diagrams for my master's thesis and XYpic seemed impossible to learn, I wrote a quick hack in Tcl/Tk to let me program diagrams instead of just editing them... for example, in this diagram about a certain way to compose natural transformations all coordinates are calculated from the coordinates of a few "anchor objects":

Two expect scripts are part of eev: eegchannel, eeg4

Some other scripts and e-scripts in Tcl/Tk/Expect: bin/mytcl, bin/mywish, e/expect.e, e/tcl-cipsga.e, e/tcl.e, eev-current/examples/tcltk.e, EXPECT/, TCL/,

Links to my old page about Tcl/Tk, my old page about MkTclApp.

(Warning (2005sep08): most of the rest of the page is several years old. Expect broken links and broken meanings.)


Expect, Tcl/Tk, MkTclApp and friends:

The online draft of Ousterhout's book:

For beginners,

On mktclapp, freewrap, Minotaur...

MetaKit and tclkit:

Wikit:

Collections of links:

Other documentation:

Tcl/Tk:

CGI:

Other: