[Gambas-user] Treeview HELL...

sbungay sbungay at ...981...
Sun Mar 4 16:30:06 CET 2007


 > You have the Item.Parent.Key.

   Umm.. no I don't. See attached PNG. The list is sorted alphabetically 
and there is no 'parent' property available. The documentation for the 
treeviewitem virtual class agrees with what we see in the attached PNG, 
there is no Parent property. Was there ever a version that did not have 
the parent property in the treeviewitem class?

 > I think you must use MoveFirst(), MoveNext(), and MoveChild() in a
 > recursive function to browse all the treeview nodes.

   I agree that this should require a recursive function to traverse the 
tree... as yet I have met with zero succcess using the methods 
available... I'll give it another whirl (what the heck.. I still have 
some hair left).
   The MoveBelow documentation does state it moves the internal cursor 
one 'visible' item below. So using this would require all nodes be 
expanded (just to be safe).

Steve.

Benoit Minisini wrote:
> On dimanche 4 mars 2007, sbungay wrote:
> 
>>   Thank you Timothy.
>>   The last attempt I made before heading off to sleep on it was as
>>follows;
>>
>>WITH TreeViewQuest
>>      .MoveFirst
>>      REPEAT
>>         message.info(.Item.Key & ", " & .Item.Text)
>>         .MoveNext
>>         message.info(.Item.Key & ", " & .Item.Text)
>>      UNTIL TreeViewQuest.MoveBelow()
>>END WITH
>>
>>   I was on the right track but being close doesn't count.
>>   Now what we need is for the virtual TreeItem class to have a
>>ParentKey property in it. 
> 
> 
> You have the Item.Parent.Key.
> 
> I'm not sure that using MoveBelow() and MoveAbove() work in all cases (they 
> are just a direct interface to the corresponding Qt methods). Maybe they do 
> not return items that are not visible.
> 
> I think you must use MoveFirst(), MoveNext(), and MoveChild() in a recursive 
> function to browse all the treeview nodes.
> 
> Regards,
> 




More information about the User mailing list