maxgui : treeview : list nodes

BlitzMax Forums/BlitzMax Beginners Area/maxgui : treeview : list nodes

hub(Posted 2006) [#1]
Hi !
i know only 'sibly' node value. How to list all the nodes inside 'sibly' (just children : bplus,bmax, b3d)?

-- all
    i
    i-- sibly
          i
          i- bplus
          i- bmax
          i- b3d


Thanks


Dreamora(Posted 2006) [#2]
TGadget.Kids (TList with TGadgets)

Eachin that to get all kids :-)

(I would really suggest to use Blide or get HotDocs to be able to use BMs real possibilities ...)


hub(Posted 2006) [#3]
Thanks dreamora. agree with you i spend a lot of time to search without success into the doc ;-)


Dreamora(Posted 2006) [#4]
No the docs don't mention "internally meant stuff" (ok the don't mention much at all when it comes to OO) although this information definitely is a must have for external usage as well.


hub(Posted 2006) [#5]
Draemora could you post an example ?


Dreamora(Posted 2006) [#6]
local node:Tgadget = selectedtreeviewnode(someTreeview)
for local gadget:Tgadget = eachin node.kids
   ' do whatever you want ;-)
next


this should work


hub(Posted 2006) [#7]
Thanks Dreamora. Just a mistake into your previous code. This code works :

Strict

Local win : TGadget =CreateWindow("My Window",40,40,600,400)
Local TreeView : TGadget= CreateTreeView (0,0,100,300, win)    
                
Local MyRoot:TGadget=TreeViewRoot(Treeview)
Local Node1:TGadget = AddTreeViewNode ("node1", MyRoot)
Local Node2:TGadget = AddTreeViewNode ("node2", Node1)
Local Node3:TGadget = AddTreeViewNode ("node3", Node1)
 
For Local n:TGadget = EachIn Node1.kids
   Notify n.GetText()
Next


While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend