Version 10 of When all you want is to run a Tk application

Updated 2002-12-19 14:20:38

Suppose someone has given you an application, saying, "Here; this is really cool. You should run it on your own computer and see." If Tk was used to develop the application, and you're unfamiliar with the Tcl/Tk language, you might not know what's involved in "running it on your own computer." Here's an explanation of the minimum you need to know:

You likely don't have Tk installed on your desktop. It won't take long to change that, though. For quickest results, you'll pick a "working directory" on your desktop, transfer a couple of (kinds of) files into it, and launch a process. At that point, the application will be running.

The two (kinds of) files are

  • the Tk interpreter, and
  • the Tk application source.

Your acquaintance has probably already given you the application source, likely named something like 'myprogram.tcl'. Make sure you have a copy of that in your working directory.

Now, copy in a working Tk interpreter. The easiest way to do this is by choosing the TclKit binary appropriate to your operating system. You might, for example, retrieve the most recent Windows version at http://www.equi4.com/pub/tk/tclkit-win32.upx.exe .

At this point, you have a copy of files in your working directory (or perhaps more; your acquaintance might package his work as a bundle of several distinct-but-related files). While at the "command prompt" specific to your operating system, move to the working directory, and enter the command

    tclkit myprogram.tcl

After a few seconds, the program will begin to execute. That's all.

myprogram.tcl is likely a "plaintext" source, so you can examine it with any common editor, and modify it as you choose. Once you've made a change, launch an instance of the updated application by repeating the command

    tclkit myprogram.tcl

at the prompt.

Several Tcl processors are available as alternatives to TclKit. "Places to find Tcl binaries and sources" is a good guide to them.


Turn a tcl-tk script into an application


Installing and launching Tk applications can be even simpler--radically simpler, in fact, than for any other applications. StarKit presents advantages over Java's .jar-s and even C's fully-compiled-and-linked executables. The StarKit-ted TclWorld at [L1 ] hints at the possibilities.


Category TclKit