Downloading and Installing Togl

Contents


Prerequisites

You should have Tcl and Tk installed on your computer. Togl works with Tcl/Tk version 8.1 and up (all recent testing has been with version 8.4). The Mac OS X version requires version 8.4 (note: versions 8.4.12 and 8.4.13 have a bug when unmapping Togl widgets).

You must also have OpenGL or Mesa (a free alternative to OpenGL with the same API) installed on your computer.

And one should be familiar with Tcl, Tk, OpenGL, and C programming to use Togl effectively.

Downloading Togl

Togl can be downloaded from SourceForge Files page.

Several prebuilt binary distributions are available as well as a source distribution.

Installing Togl

Installing prebuild binaries

Prebuilt binaries provide a Togl2.0 directory, the togl.h, togl_ws.h and toglDecls.h include files, and the togl stub library (libToglstub2.0.a or Toglstub20.lib, etc). The Togl2.0 directory needs to copied into one of the directories on Tcl's package path (type puts $auto_path in the Tcl interpreter to see the list of directories). If you have C code that needs to access Togl's subroutines directly, place the include file in the same place as Tcl's include file and the stub library in the same place as Tcl's stub library.

Installing from source

Togl uses the Tcl Extension Architecture to be able to build on the same platforms Tcl can be built on. In addition to the Togl source, you will need to have the Tcl and Tk source distributions because not all installations have the needed Tcl and Tk internal header files.

How you link with Togl depends on how you're planning to use it. There are basically three ways of using Togl with your application:

Since Togl is compiled into a shared library using the Tcl/Tk stubs-interface, the same binary can be used with any version of Tck/Tk from 8.1 and up. See README.stubs for more info.

Specific platform notes follow:

Unix/X11 usage

Unix/X systems only need the public Tcl/Tk include files. Just configure, make, and optionally make install.

Windows 95/NT/2000/XP usage

Windows platforms need tkWinInt.h and other internal Tk header files. So you need a Tcl/Tk source distribution in addition to the Togl distribution (or copy over the various include files).

Here's the minimal way to build Togl with Tcl/Tk using the gcc that is distributed as part of the cygwin tools (Microsoft's compilers work too):

VER=8.4.12
SRCDIR=`pwd`

cd $SRCDIR/tcl$VER/win
env 'CC=gcc -mno-cygwin' ./configure --enable-threads
make libtclstub84.a

cd $SRCDIR/tk$VER/win
env 'CC=gcc -mno-cygwin' ./configure --enable-threads
make libtkstub84.a

cd $SRCDIR/Togl2.0
env 'CC=gcc -mno-cygwin' ./configure --with-tcl=../tcl$VER/win --with-tk=../tk$VER/win

make
The resulting Togl20.dll and pkgIndex.tcl should be installed into your Tcl installation just like any other package.

If you change all of the above make's to make install instead, then the Togl package is installed correctly.

Mac OS X usage

These special instructions are for building the Aqua version of Togl. Mac OS X needs tkMacOSXInt.h and other internal Tk header files. Unfortunately, the Tcl and Tk frameworks that Apple distributes are missing the internal headers. So you need a Tcl/Tk source distribution in addition to the Togl distribution (or copy over the various include files). You would probably want a newer version of Tcl and Tk anyway because each minor revision of 8.4 has many Aqua bug fixes.

Here's one way to build Tcl, Tk, and Togl on Mac OS X (assuming they are all in the same directory) to install in your home directory:

VER=8.4.12

mkdir -p ~/bin
make -C tcl$VER/macosx install PREFIX="${HOME}" INSTALL_PATH="${HOME}/Library/Frameworks"
make -C tk$VER/macosx install PREFIX="${HOME}" INSTALL_PATH="${HOME}/Library/Frameworks" APPLICATION_INSTALL_PATH="${HOME}/Applications"

cd Togl2.0
./configure --prefix="${HOME}"
make install

Version History

Version 1.0 — March, 1996

Version 1.1 (never officially released)

Version 1.2 — November, 1996

Version 1.3 — May 2, 1997

Version 1.4 — September 17, 1997

Version 1.5 — September 18, 1998

Version 1.6 — May 7, 2003

Version 1.7 — Jan 2006

Version 2.0 — Apr 2008


Future plans

Patches for the following are especially welcome:
Hosted by SourceForge.net Logo