[MaxGUI] How to clear a treeview?

BlitzMax Forums/BlitzMax Beginners Area/[MaxGUI] How to clear a treeview?

Jake L.(Posted 2006) [#1]
Hi,

I'd like to clear a treeview gadget. Calling myTreeview.Clear() throws an "invalid gadget type"-error.

Anyone knows how to do that?


degac(Posted 2006) [#2]
Use
FreeTreeView(node_tree:tgadget)


Don't use direct method in MaxGUI, sometimes they're not safe because there's more behind the scene


Jake L.(Posted 2006) [#3]
FreeTreeView doesn't exist. You mean FreeTreeviewNode() ?

Using this with root clears my tree, but how to add nodes again?


Dreamora(Posted 2006) [#4]
In that case, clear all childs and let the root remain.


degac(Posted 2006) [#5]
Sorry for the error: I mean FreeTreeViewNode...


Jake L.(Posted 2006) [#6]
Sure, there's no problem writing my own ClearTreeView().
But seeing Clear-commands for list/combo-boxes I thought there have to be a ClearTree-function I missed.