Tcl Examples

Last update : January 4, 1997

This directory contains a variety of very simple SWIG Tcl/Tk examples.
The examples should be compatible with Tcl 7.3, Tk 3.6 and all
newer versions.  Most of the examples have also been tested under
Tcl 8.0a1.

Here's a short summary :

simple        - Simple example from user manual.

matrix        - A few matrix computations

tree          - Binary search trees in Tcl.

graph         - Simple code for building directed graphs

except        - One possible way of generating Tcl/Tk exceptions.

tcl_plugin    - Extensions to the Tcl Netscape plugin. (tested with
                beta releases of the plugin, may not work in
                current releases).

dynaload      - Example showing how to build a dynamically loadable
                extension.

dynac++       - Dynamic loading of a C++ module.

c++           - A variety of simple C++ examples.

blttix        - Shows how the SWIG library can be used to combine
                other Tcl extensions.

typemaps      - Examples showing how to use SWIG typemaps.

Most of the examples will statically link new versions of tclsh
and wish (since this is easy and its portable).  To build
each example, simply go to that directory and type 'make'.

All examples rely on the file 'Makefile.template' in the top
level directory.  If 'make' fails, you may need to edit this
file to locate your Tcl/Tk installation.

As of SWIG1.1, a new Tcl8.0 interface is available that uses
Tcl's object interface.   Many of the examples can use this
if you type 'make tcl8'.   Using Tcl8.0 will probably require
modifications to the file 'Makefile.template' in the top
level SWIG directory.   Both the old and new SWIG Tcl modules
are compatible with Tcl 8.0.  (The new one runs significantly
faster however).

The examples will generally not compile if SWIG has not been
installed.  To run the examples without installing SWIG,
set the SWIG_LIB environment variable to the following :

      setenv SWIG_LIB ${pathname}/SWIG1.1/swig_lib

Where ${pathname} is the path where the SWIG source is located.


