[Prev][Next][Index][Thread]

Re: <tree-node> in DUIM



Read Chris Double's message, since it's good.

<tree-node> is, in fact, instantiable, but simply calling make(<tree-node>)
isn't quite enough.  It's arguably a (small) design flaw that this is the
case,
but there you go.

There is a function called 'make-node' which is used to create a tree node
on behalf of a tree control.  It takes two required args, the tree control
and the object which the node will contain.  After making a tree node,
you then explicitly add it to its parent.

You can read the code in duim/gadgets/tree-controls and in the portable
implementation of tree controls in duim/panes/tree-control-panes.

Have fun!

oodl@my-deja.com wrote in message <8geqrn$1tq$1@nnrp1.deja.com>...
>Hi,
>
>The <tree-node> class is listed in the DUIM documentation as being an
>"Open abstract instantiable class".  I should be able to call make on
>it, right?  When I do, I get an error saying that the class is abstract.
>It is abstract, but it is instantiable, so I think I should be able to
>call make on it get an instance of a subclass.  This is in Functional
>Developer 2.0.
>
>I am not sure how to populate a <tree-control> with children so I would
>appreciate having an example showing how to populate the control with
>pre-existing children, not only with children generated from a method
>like this:  method (x) vector(x * 2, 1 + (x * 2)) end as they do in the
>sample code.
>
>I wanted to do something like this:
>define constant a1 = make(<tree-node>, object: "a1");
>define constant a2 = make(<tree-node>, object: "a2", parent-nodes:
>list(a1));
>define constant a3 = make(<tree-node>, object: "a3", parent-nodes:
>list(a1));
>
>
>thanks!
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.





Follow-Ups: References: