Clear contents of DTree panel?

It appears that the :Clear() method is stubbed out. What’s the right way to empty a DTree panel (or otherwise load a different set of nodes into it)?

https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dtree.lua#L66 :v:
I think, you can recreate the RootNode or clear its dtree_node children

Recreating the RootNode worked. I did tree:Root():Remove() and then the entire self.RootNode block from the PANEL:Init.

It works, but man I really wish there was a less-bad way to do it. I’ll mark this as solved after a day or so, in case someone knows a better way.

I will look into implementing DTree:Clear() for future GMod update

Done:

I literally went to show this problem to a coworker and was like “wait, that line wasn’t there last night!” and the commit log said it was only an hour old.

Thank you very much! I’ll now mark this as solved.