Page 1 of 1

programming a forest in the TreeControl package.

Posted: 3 Oct 2021 11:08
by B.Hooijenga
Thomas,

Long, long ago I wrote a personal information manager, The treeControl package did not exist and I used the treeViewControl package. I still use it..

But I have two good reasons for changing to the treeControl package.
1. loaded with more than 7000 items, my depthfirst routine .uses up the stackmemory..
2. the treeviewControl, although still there, has become legacy and is no longer supported

In my old program the "tree" looks as follows: I believe this is called a forest. ( a disjoint collection of trees).
treeview.PNG
treeview.PNG (3.92 KiB) Viewed 305 times

I tried to program such a forest in the treecontrol package but did not succeed.
I am using objects and based my attempt on the third example in the VIP treeControlDemo.

All the VIP examples are using exactly one root and the compiler rejects all my attempts to build a forest.
But there is also a predicate getRoot_nd() -> in the treeModel which suggests that more roots are possible.


It raised a question for me: is this forest-structure possible in the treecontrol package?

Kind regards,

Ben

Re: programming a forest in the TreeControl package.

Posted: 4 Oct 2021 8:13
by Thomas Linder Puls
Yes, if getRoot_nd returns more than one root, your tree control will contain a forest.

Re: programming a forest in the TreeControl package.

Posted: 4 Oct 2021 14:10
by B.Hooijenga
Thomas,

Thank you. I give it another try.

Kind regards

Ben