Short Tclet

This is an experiment to see how small the tclet source can be. This tclet has the source, short.tcl, which contains the single Tcl command:

   eval $embed_args(program)
So we write the entire program into an attribute, named program, in the embed tag. Which looks like this:
    <embed align=center src=short.tcl width=100 height=100
      proc say-hello {} {
        .l configure -text {Hello world}
        after 5000 .l configure -text {}
      pack [button .b -text hello -command say-hello] -side top
      pack [label .l -text {}] -side top
So may be the only tcl source file you need.

Attribute values are limited to 1024 bytes in length. They should be enclosed in single or double quotes with the chosen quote and the ampersand rewritten into an entity reference within the string.

Roger E Critchlow Jr
Last modified: Fri May 16 19:39:05 MDT 2003