Topic was automatically imported from the old Question2Answer platform.
Asked By
Olaf007
I have this basic tutorial script from the documentation…
func _ready():
var tree = Tree.new()
var root = tree.create_item() # Here the 1st TreeItem is returned to root
tree.set_hide_root(true)
var child1 = tree.create_item(root)
var child2 = tree.create_item(root)
var subchild1 = tree.create_item(child1)
The TreeItem inherits from Object and not from Node so I suppose I cannot add a custom Control node (and its children) to the tree!?
Wouldn’t this be a useful feature?
If you need full-fledged controls it might require to make a different node, Tree is really not designed to hold controls like that (and won’t yield the same performance with many items). You might be able to get away with expander buttons and VBoxContainer nodes maybe, like the inspector appears to do.