> hi there,
> 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 ?
The only way to do this using MetaCard built-in features would be to
use a listBehavior field, putting special characters (e.g., + and -,
or a couple of the characters from the Symbol or WingDings fonts)
where the open/close buttons should be. You'd have to pad each line
with spaces as needed to get the level indentation right. You would
use the clickText and clickLine functions to determine whether the
user clicked on one of the open/close buttons, and refill the field
contents as appropriate.
As for managing the data, an associative array would work well for
that. For each item in the list, you'd have an associative array
element with the subcategories for that item (indexed by the name of
the item). Opening a section would be achieived by getting the text
of the line the user clicked on, deleting the leading spaces and the
open/close button character, and then using that string to lookup the
new lines to be added.
You could also do this by running a subprocess of a program that uses
a widget from some other toolkit, or by getting the C code for one of
these widgets and rearranging it to draw into a pixmap and setting the
pixmapId of an image to display it (see the life demo in the External
Tutorials stack for an example of how to do this).
Regards,
Scott
> cheers in advance.
>
> ray.
>
***************************************************************
Scott Raney raney@metacard.com http://www.metacard.com
Any sufficiently advanced technology
is virtually indistinguishable from magic -- Clarke's law