TkGS
==========

This archive contains the source code of the current draft implementation of
TkGS. It consists of a Tcl loadable extension implementing a simple
TkGS-enabled widget. The extension requires Tcl 8.3.2 or newer. It uses Tcl
stubs facilities by default, so that it will work with different versions
of Tcl without a recompile.

The sources are cross-platform. An autoconf based build system is supplied
for Unix and Windows users. Windows users will also need to download Cygwin
from http://sources.redhat.com/cygwin/.

TkGS takes the form of a Tcl loadable extension that provides the package
TkGS version 1.0. The extension defines several device drivers: Win32 and
Xlib (native on Unix, emulated on other platforms) for windowed output,
PostScript for PS file generation, and "Canvas script", a special driver
that generates Tk canvas commands from TkGS calls. Each of these drivers are
included as static packages in the TkGS core, but the modular nature of TkGS
makes it possible to build them as separate loadable extensions.

Along with the core, a sample TkGS-enabled widget is provided. The widget itself
is a modified "square" widget from the Tk source (tkSquare.c). The only
modifications are drawing related (Xlib calls replaced by TkGS calls) and
extra commands for canvas and PostScript output. Again, it also takes the
form of a Tcl loadable extension that requires package TkGS version 1.0 and
provides package TkGSSquare version 1.0.


Building TkGS
=======================

Run the configure script and pass the location where Tcl and Tk are built
using the --with-tcl and --with-tk flags. You can then run "make ; make install"
to build and install tkgs. If you are building on Windows with Cygwin, you
need to run CFLAGS="-g -mno-cygwin" ; export CFLAGS at the bash shell
prompt before running ./configure.

It is also possible to cross compile Tcl, Tk, and Tkgs for Windows from
a Unix system. You will need to install a mingw cross compiler and
use the --host option to each configure (see http://www.mingw.org).

This square demo is provided as a shared library and a file square.tcl that
shows how to use the widget. The square demo demonstrates a basic TkGS-enabled
widget, such as windowed display, canvas script generation, and PostScript output.
