[Gambas-user] TreeView+TreeViewItem problems continued

Benoit Minisini gambas at ...1...
Tue Oct 17 18:59:21 CEST 2006


On Tuesday 17 October 2006 11:21, Christopher Brian Jack wrote:
> is:
>
> DIM hLVItem AS .ListViewItem
>
> broken in 1.9.44?
>
> I'd like to be able to pass the handle around for things like recursive
> function definitions (both the depth-first and breadth-first traversals
> may be done recursively) but trying it the above way (as shown in the
> documentation) doesn't work.
>
> I mentioned in a previous post I'm having trouble with trying to descend
> through the TreeView items with either breadth-first or depth-first
> visitation.  Even if I could pass these values I think there may still be
> issues with losing the cursor position higher up in a recursive call
> chain.
>
> Does no one use this control?
>
> It would appear to me that to save the contents of a TreeView one needs to
> be able to visit the elements in-order to save them and keep the
> relations.
>
> Also this object has no simple iterator (one that can be used without
> knowledge of the elements--namely that they have parents and children as
> is the case in a TreeView).  A simple iterator can be used when it is not
> required that the traversal follow any order, only that each element be
> iterated (visited) once.  I know as I already tried FOR EACH with no luck.
>

You can save and recover the Item property (the internal cursor) by doing:

DIM sSave AS String

sSave = MyTreeView.Item.Key
...
MyTreeView.MoveTo(sSave)

I think too that a FOR EACH on ListView, TreeView, etc. would be useful, but I 
never had the time to do it. It is not as simple as it appears, because 
iterators should care with deleted items.

Regards,

-- 
Benoit Minisini





More information about the User mailing list