Treeview gadgets don't work?

BlitzMax Forums/BlitzMax GUI Programming/Treeview gadgets don't work?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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