Discussions related to Visual Prolog
B.Hooijenga
VIP Member
Posts: 51
Joined: 11 Jul 2002 23:01

programming a forest in the TreeControl package.

Unread post 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 221 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
User avatar
Thomas Linder Puls
VIP Member
Posts: 1244
Joined: 28 Feb 2000 0:01

Re: programming a forest in the TreeControl package.

Unread post by Thomas Linder Puls »

Yes, if getRoot_nd returns more than one root, your tree control will contain a forest.
Regards Thomas Linder Puls
PDC
B.Hooijenga
VIP Member
Posts: 51
Joined: 11 Jul 2002 23:01

Re: programming a forest in the TreeControl package.

Unread post by B.Hooijenga »

Thomas,

Thank you. I give it another try.

Kind regards

Ben
Post Reply