
Tree Widget for TK Version 3.3
------------------------------


Introduction
------------

This Directory contains the sources for a Tk-3.3 based widget for
displaying dynamic trees. The tree widget is implemented in C++ 
and has been tested on a Sun4 using gcc-2.3.3.

Note: if you use g++/gcc, you can use the standard Tk library
main and just define your own commands in tkAppInit.c.
However, other C++ compilers require the main routine to be
compiled for C++. In this case, you can make a dummy C++ main,
rename the TK main routine to tkmain and call it from the C++ main:

	extern "C" tkmain(int argc, char** argv);
	main(int argc, char** argv) {
		return tkmain(argc, argv);
	}


Features of the Tree Widget
---------------------------

With the tree widget, you can display a tree in a Tk canvas. The nodes
can be made up of any number of canvas items or even other Tk widgets.
You create the objects that make up a node and the line that connects
it to its parent and pass them to the tree widget. After this the tree
widget manages the positions of the nodes and end points of the tree
lines.  Operations are available for inserting, moving and removing
nodes and subtrees and for querrying the position of a node in the
tree. The tree can be displayed horizontally or vertically.


Documentation
-------------

There is a manual page in the man directory that describes
the tree widget in detail for those wishing to use it in tk scripts.


Requirements
------------

The following software is required to compile this release:

from sprite.berkeley.edu:/tcl:

    tk-3.3b3 or later
    tcl-7.0b3 or later


Compiling 
---------

1. Edit src/master.mk

Edit the include makefile src/master.mk and set the path names and
compile options for your system.  This file sets the compiler options
for locating the Tk, Tcl and X11 libraries and include files.

2. Type make

Type make from the top level directory. This compiles the class library
libOS.a and the tree widget library and creates an executable named
"treesh" that is a modified version of the Tk "wish" shell.


Demos
------

In the demos directory are two demos: 

	- simple - just demonstrates the tree widget by creating a 
	           static tree

	- dirtree - allows you to navigate through the directory tree
		    by double clicking on node labels or bitmaps.
	            (Note: this is a simplified version of the dirtree
	            demo in te-3.2, the previous version. I wanted to
	            keep things as simple as posible this time, to make
	            it easier to understand. Its not meant to be a real
	            application).


Enjoy,

Allan Brighton
Software Consultant
allan@piano.sta.sub.org (Home)
allan@multinet.de (work)
          
