The TclJava Demonstration

by Scott Stanton and Ken Corey
scott.stanton@eng.sun.com
ken.corey@eng.sun.com

Table of Contents
 1. Introduction
 2. Documentation
 3. Compiling and Installing
 4. Getting Started
 5. Support/Bug fixes
 6. Acknowledgements
 7. Changes
 8. Known bugs

1. Introduction
---------------

This directory contains the sources to combine Java and Tcl so that 
one can write TCL commands that are defined in Java, or eval tcl
commands from within a Java program.

This code was run against tk4.1b2 and tcl7.5b2, and tk4.0 and tcl7.4.
Please read the Makefile, and adjust things appropriately.  The
define -DCREATEMAINWINDOWHACK *must* be set correctly to depend on
the version of Tcl/Tk you're compiling against.

2. Documentation
----------------

The doc/refman.html directory contains an html reference manual for
the library. The source code is loaded with comments.  Most of the 
files go into the library, except for TclTest.java, which is an
example of how to use this library.

3. Compiling and Installing
---------------------------

Edit the Makefile, setting the parameters as appropriate for your
system. (This only applies to Unix for now.  I hope to have PC
ports included soon, but couldn't get it together in time for this
release.)

4. Getting Started
------------------

Please refer to the appropriate README's for tk/tcl and java. They
contain pointers about where to find further info about these
languages.

The quick-start:
Either edit the new program in the same directory that you untarred
the tcljava package into, or ensure that the libjtk, libtk* and
libtcl* libraries are in a directory pointed to by your
LD_LIBRARY_PATH environment variable.

It's lame, I know, but for now, only the unix make file works.  I
plan to develop environments for the other platforms for the next
release, but for now you're stuck with unix.

To run the example once you've run 'make' and gotten no errors, you
enter:

java TclTest

This presents a Tk window to work with.

This library will not work as an applet, nor will you be able to
view it the applet viewer.  The problem is that Netscape's Java
doesn't allow natively defined methods.  This is the show stopper.

5. Support/Bug fixes
--------------------

If you find a bug, please take the time to drop a note to me at the 
address above.

6. Acknowledgements
------------------

Thanks to Tobin Hill for some last minute suggestions for release 0.1!
thanks to Kevin Quinn for the idea of making the 'Command' class an
interface, so that existing class hierarchies could use the command
structure.

7. Changes
----------

0.2
  Provided a definition in the Makefile that allows for an 'exec' 
  replacement.  NOTE: this is a substantial reduction in the power
  of the 'exec' statement...it is simply the 'system' command.

  Changed the 'Command' object to be an interface, so that any Java
  object can become a Tcl command.

8. Known Bugs
-------------

Yeah, we've got 'em all right:

1) exec is broken.
 Tcl's original 'exec' hangs the virtual machine.  A faux 'exec'
 is provided that offers *much* less functionality, and doesn't
 directly support capturing the output.  If you need this capability,
 you'll have to direct output to a file, and then read from that file.

 Ugh.

2) after is broken.
 Tcl's 'after' command returns with no delay at all.

-Ken Corey
Sun Laboratories, Inc.


