hi
At the moment i'm looking for a function which can delete items of a treeviewnode. Can somebody help me?thx
At the moment i'm looking for a function which can delete items of a treeviewnode. Can somebody help me?thx
SuperStrict Local MyWindow:TGadget=CreateWindow("TreeView Example", 40,40,400,400) Global MyTreeView:TGadget=CreateTreeView(5,0,200,330,MyWindow) EnumFiles(BlitzMaxPath(),MyTreeView) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETACTION Local Node:TGadget = SelectedTreeViewNode(MyTreeView) FreeTreeViewNode(Node) End Select Forever End Function EnumFiles:Int(Dir:String, Parent:TGadget) Local Folder:Int=ReadDir(Dir) Local File:String Local FullPath:String Repeat File=NextFile(Folder) If File=".." Or File="." Or File=Null Then 'Do Nothing Else fullPath = RealPath(Dir+"/"+file) If FileType(FullPath)=FILETYPE_DIR Then Local handle:TGadget=AddTreeViewNode(file,Parent,1) handle.context=FullPath Else AddTreeViewNode(file,Parent,0) EndIf EndIf Until File=Null End Function