Treeview gadgets don't work?
BlitzMax Forums/MaxGUI Module/Treeview gadgets don't work?
| ||
This example shows that the added nodes are not being seen when added.SuperStrict
Import Maxgui.drivers
Local MyWindow:TGadget=CreateWindow("TreeView Example", 40,40,400,400)
Global MyTreeView:TGadget=CreateTreeView(5,0,200,360,MyWindow)
Local files:String[]=LoadDir(BlitzMaxPath())
Local File:String
For file = EachIn files
AddTreeViewNode(file, MyTreeView)
Print "file added"
Next
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
End Select
Forever
End |
| ||
You need to wrap the treeview gadget with TreeViewRoot() for root nodes:SuperStrict
Import Maxgui.drivers
Local MyWindow:TGadget=CreateWindow("TreeView Example", 40,40,400,400)
Global MyTreeView:TGadget=CreateTreeView(5,0,200,360,MyWindow)
Local files:String[]=LoadDir(BlitzMaxPath())
Local File:String
For file = EachIn files
AddTreeViewNode(file, TreeViewRoot(MyTreeView))
Print "file added"
Next
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
End Select
Forever
End |
| ||
| Ah. Great. Thanks! |