[Gambas-user] TreeView.Count value differs using qt rather than gtk

Matteo Pasotti matteo.pasotti at ...626...
Tue Jan 26 15:35:16 CET 2010


Doriano Blengino ha scritto:
> Actually I expressed myself badly. Example:
>
> Tree1:
>   - item0
>   - item1
>     - item1.0
>
> Tree1.count is  3      (global count)
> Tree1.Children.count is 2 (tree1 has two children)
> Tree1.Children[0] is item0
> Tree1.Children[0].count is 0
> Tree1.Children[1] is item1
> Tree1.Children[1].count is 1
> Tree1.Children[1].Children[0] is item1.0
>
> AChild = Tree1.Children[1]
> for subchild in Achild
>   ...   ' just the single child of item1: item1.0
> next
>
> ask("Sure to copy " & tree1.count & " file/directories?)   ' we will 
> copy 3 items
> for child in Tree1.children
>    processchild(subchild)   ' this line will execute two times
> next
>
> sub processchild(child as TreeChild)
>   dim subchild as TreeChild
>
>   ' do something with it
>   alert("Copying " & child.text & "...)
>   ' are there subchildren? Do them recursively
>   for subchild in child.children
>     processchild(subchild)
>   next
> end
>   
The Doriano's way could be a good choice IMHO.
However, I think that the differences between the two components should 
be resolved: how it will be implemented it's not so relevant for me 
(currently both implementations works correctly), the important is to 
have a unique behavior.
Thanks everybody, especially to the gambas developers who are doing a 
great job.
--
Matteo




More information about the User mailing list