![]() |
XML and open source software for down-to-earth business solutions |
|
|
TreeWidgets 1.0a1 DocumentationREADMEAugust 29, 2002 IntroductionTreeWidgets is a Python-Tkinter library that provides general-purpose tree widgets. I decided to write it because I found that, though there are several Tkinter tree widgets available, the ones I have tried were all designed to work with one particular type of data structure, and were hard to adapt to other data structure. My goals in creating the TreeWidgets library are:
This being the first Alpha release, there are numerous bugs and unimplemented features, but at least the first goal is substantially realized, and the package should be usable with a little work. Modules in the PackageProvides TreeWidget, the base class for TextTree and CanvasTree. In general, applications should use one of the subclasses rather than instantiating TreeWidget directly. Provides TextTree, a TreeWidget based on the Tkinter Text class. Although this class lacks the ability to display graphical tree branches, it should give slightly better performance than CanvasTree, since TextTree positions nodes on the basis of text lines and indents, rather than X and Y offsets. NOT YET IMPLEMENTED. Will provide CanvasTree, a TreeWidget based on the Tkinter Canvas class. Provides TreeNode, the basic unit of TreeWidgets data structures, and its subclasses DOMTreeNode (for XML DOM objects), FSTreeNode (for directory trees), TWTreeNode (for a Python data structure known as TWStruct--see twstruct.html for more information), and CustomTreeNode (for all other data structures). Various integer constants used throughout TreeWidgets. Studying this module will help you understand how to use TreeWidgets effectively. Miscellaneous functions. Currently provides only a warn() function. Built-in bitmap and photo icons. What's New
See ChangeLog for detailed changes, and API docs for usage. UsagePlease see the API documentation in apidocs/ and the examples in the demos/ subdirectory. INSTALLIf you have Python 2.0 or later installed, you should be able to install TreeWidgets with the command:
python setup.py install
Otherwise, you can either install the DistUtils package from:
http://www.python.org/sigs/distutils-sig/download.html
or you can simply unpack the archive in your Python site-packages directory (typically found at /usr/lib/python<version>/site-packages or /usr/local/lib/python<version>/site-packages on POSIX systems, or at C:\Python<version>\Lib\site-packages on Windows). BUGS
Known Bugs and Limitations as of 8/26/2002
==========================================
Bugs:
-----
* When a tree is first displayed, Nodes with children appear
with a 'minus' icon instead of a 'plus', even if they are
collapsed. The icon does not change to a 'plus' unless the
node's parent is collapsed and re-expanded.
* When you double-click a node, text may be selected across
multiple lines.
* Long node names wrap across lines, with no indentation on
the second and subsequent lines.
* When a TextTree is displayed with no icons, selecting a
node causes the background and foreground to change
starting with the *second* character in the label instead
of the first.
Limitations:
------------
* Most Tkinter configuration options are currently ignored.
* Functions for showing the content and attributes of a node
are unimplemented.
* Font selection is unimplemented.
TODO
To-Do List for TreeWidgets
==========================
* Implement CanvasTree
* Implement lazy instantiation of sub-trees. This is
particularly valuable for potentially large data structures
such as file systems; currently, regardless of how many
levels are expanded in the display, the entire data
structure must be read in and wrapped in TreeNode objects
before the tree is displayed.
* Implement Tkinter configuration options and font selection.
* Implement TreeWidget.showContentFunc, TreeWidget.showAttsFunc,
and TreeWidget.glimpseFunc.
LICENSE
Copyright (c) 2002, Matthew C. Gushee
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
Neither the name of the author nor the names of contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
|
![]() |
Copyright © 2003 by Matt Gushee :: Last modified: December 4, 2002 |