Re: tree list

Mr. Eddy Mcdaid (eddy@kim.iscm.ulst.ac.uk)
Thu, 5 Jun 1997 11:02:19 +0100 (BST)

On Wed, 4 Jun 1997, Ray Cheung wrote:

> I would be grateful if anyone can suggest to me what is the
> best way of implementing something similar to expandable and
> collapsable tree lists in metacard ?

First of all you will have to decide how the tree structure is input - as
the result of a find command in Unix for example, read from a file or
created interactively by the user. Then you will have to decide how to
represent the tree internally in MetaCard. You could do this using arrays
but I think it would be easier to use nested groups to represent the
structure. So each node on the tree would consist of a group containing a
button (minimal case = root node) and a group containing the children of
that node. The button would store the folded/unfolded state of the node
and this would cause the children group to display/not display.
Indentation would be more or less automatic but you might want to play
with the leftMargin or something like that. You will probably end up
fighting with the group object geometry manager at times.

The tree would need to be created using a script which may be slow on
computationally challanged equipment. Modifying the tree such as adding or
deleting nodes would be a little more difficult while direct manipulation
such as drag and drop would be much more difficult.

If you are using MC on Unix it might be worth looking at using a separate
process for the tree thing - there are plenty of tree-like widgets
around. MC could then talk to the process through a pipe to set and query
the state of the tree. A lot less work and more efficient.

Hope that helps and good luck,

Eddy Mc Daid.

-------------------------------------------------------------------
Eddy Mc Daid Project Manager Interactive Systems Centre
Telephone: +44-1504-375622 Fax: +44-1504-370040
WWW: http://www.iscm.ulst.ac.uk/isc/isc-staff/eddy.html
-------------------------------------------------------------------
Any opinions expressed are mine but may be freely shared by others.