First steps: talking to Java
Assuming that installation went correctly, you can start up
tclsh from the command line:
> tclsh
(We will adopt the convention that lines starting with ">" are
shell commands, while undecorated lines are commands to the Tcl
interpreter.) In Windows, you can also start
tclsh by selecting
the appropriate entry from the Start menu.
Unfamiliar with Tcl?
Tcl comes supplied in two versions. tclsh is just the Tcl
interpreter -- when you start it you get a simple prompt (%), at which
you can type Tcl commands, using any of the commands documented on the
Tcl
commands manual pages. wish is the windowing shell -- when
you start it you get the same interactive console (on Windows you get
a separate window) and access to the Tk graphical user interface
commands documented on the Tk
commands manual pages.
To access the Tcl Blend commands, you need to load the
java
package:
package require java
Tcl will load the Tcl Blend shared library, load the Java classes used
by Tcl Blend, and add a few commands to the Tcl interpreter.
What's a package?
One of Tcl's great strengths is it's ability to be easily extended
with new commands. These days, new commands are always supplied
in a package, which is loaded and otherwise manipulated
by the package command. Packages can be written in C, Tcl,
or (as we will see) Java.
OK, we're ready to go! (If any of that didn't work, go to
Christopher's
Troubleshooting
Tcl Blend page.)
We can now type Tcl commands that create and
manipulate Java objects. Click on each of the following links to step
through the basic tutorial.