Tree-3.6.2 - A Tree Widget for Tk based on C++ and [incr Tcl] -------------------------------------------------------------- Introduction ------------ This Directory contains the sources for a Tk-3.6 based widget for displaying dynamic trees. The basic Tk tree widget is implemented in C++. I've developed a simple C++ class hierarchy for writing Tcl commands and Tk widgets that you might want to take a look at, if you also work with C++. See the man pages in the man directory of this distribution for more information. I've also added an Itcl "Tree" class, based on the C++ "tree" widget. It makes working with trees a little easier by adding an extra layer over the basic tree widget. See the man page "itclTree" for a description of the Itcl "Tree" widget. 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 are man pages in the ./man directory describing the tree widget and some of the C++ and Itcl classes as well. Requirements ------------ I've tested this release on SunOS-4.1.3 with gcc(2.5.8 and 2.6.0) and Sun CC(2.0 and 3.0). An earlier version was working with Tk-Win on Dos/Windows, although I have made changes since then. I don't have a PC to test this version, so let me know if there are any problems. The following software is required to compile this release: tk-3.6 (or later) tcl-7.3 (or later) itcl-1.5 (or later - itcl-1.3 will not work!) The following packages are optional: (some of the Itcl classes use some of thier features) BLT-1.7 (or later, for busy cursor, drag&drop) TclX-7.3b (or later, min, max, lassign) Note: The basic C++ tree widget only requires Tcl and Tk. The [incr Tcl] interface and the demos that use it need Itcl and the other packages. One of the demos (dirtree) uses only plain Tcl/Tk. Compiling --------- 1. run ./configure from the top level directory. 2. Type: make This creates a library "libTkTree.a" and a binary "tree_wish" for running the demos. 3. Type: make install This installs the library, binary and the tcl files. Demos ------ There are some simple demos in the ./demos directory. To try them out, cd to that directory and run one of these scripts: simple - just demonstrates the tree widget by creating a static tree using the [incr Tcl] interface dragdroptree - displays a tree a lets you move nodes and leaves around in the tree with drag&drop (right mouse button is used for drag&drop). dirtree - directory browser demo. This is an older demo that doesn't use the [incr Tcl] interface. Clicking with mouse B2 on a directory opens up a file list in the tree. Double-Click with B1 shows or hides the subdirectories. Acknowledgments: ---------------- I originally developed the tree widget on my own time while learning Tcl and Tk. I added the TclCommand and TkWidget C++ classes in an attempt to standardize the C++/Tcl interface as part of a project at Siemens/Nixdorf AG in Munich. Thanks to Arnulf Wiedemann (Arnulf.Wiedemann.@mch.sni.de) and Wolfgang Grosser (Wolfgang.Grosser@mch.sni.de) for thier ideas and for letting me make this public domain. Copyright: ---------- This is free software. See the Copyright file with this distribution for details. Please send suggestions, bug fixes, etc. to me. ======================================================================= Allan Brighton Free-lance Software Engineer E-mail: allan@piano.sta.sub.org (home) or: (until end of March 95) abrighto@eso.org (work) Ph: [+49] (0) 8094-1370 Zaissing 3 8019 Steinhoering, Germany (near Munich) =======================================================================