[Gambas-user] enumerate treeview items

Christopher Brian Jack brian at ...1334...
Sat Oct 28 14:42:55 CEST 2006


On Sat, 28 Oct 2006, Christopher Brian Jack wrote:

In the snippet I forgot probably the most important part... Namely calling
tviTheTreeView.ForEach() whereever you want to iterate the host TreeView
in your code.

> 'We have a form containing a TreeView called tvTheTreeView
> PRIVATE tviTheTreeView AS CIterateTreeView
>
> PUBLIC SUB form_Open()
>   tviTheTreeView=NEW CIterateTreeView(tvTheTreeView, ME, "tviMyIterator")
>   ...
> END
>
> PUBLIC SUB form_Close()
>   'keep this in or you get problems with circular referencing
>   tviTheTreeView=NULL
> END
>
> PUBLIC SUB tviMyIterator_next(hostob AS TreeView, key AS String,
>   state AS Integer)
>   SELECT state
>     CASE CIterateTreeView.IterBegin
>       'called before iteration starts
>     CASE CIterateTreeView.IterDone
>       'called after iteration is complete
>     CASE CIterateTreeView.IterVisit
>       'called once for each .TreeViewItem visited
>       'you have to use the key arg since .TreeViewItem
>       'do not work for method parameter passing
>   END SELECT
> END

.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| oevna at ...1544...
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
Hi Humans, my email address uses rot13 cipher





More information about the User mailing list