GUI tree node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By turgotZ
:warning: Old Version Published before Godot 3 was released.

I’m trying to set up a navigation system based on the tree node. I’ve used the example code in the class doc. I cannot get it to show in the node area once the app is run.

Seems I’m missing something. Does someone have a working example? Or some hints

Thanks

:bust_in_silhouette: Reply From: binogure

Try this

extends Tree

# class member variables go here, for example:
# var a = 2
# var b = "textvar"

func _ready():
  var root = self.create_item()

  root.set_text(0, 'test')

  var child1 = self.create_item(root)

  child1.set_text(0, 'test-1')

  var child2 = self.create_item(root)

  child2.set_text(0, 'test-2')

  var subchild1 = self.create_item(child1)
  subchild1.set_text(0, "test-3")