# Clone tree label not showing

**URL:** <https://forum.defold.com/t/clone-tree-label-not-showing/78380>\
**Category:** Bugs\
**Created:** [October 8, 2024, 7:32pm UTC](https://forum.defold.com/t/clone-tree-label-not-showing/78380 "2024-10-08T19:32:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ideate\_Games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ideate_games/32/37678_2.png) [@Ideate\_Games](https://forum.defold.com/u/Ideate_Games)\
**Post date:** [October 8, 2024, 7:32pm UTC](https://forum.defold.com/t/clone-tree-label-not-showing/78380/1 "2024-10-08T19:32:06Z")

</div>

[new to Defold; experienced programmer]

I am cloning a simple node tree that is a box with a label. Literally a colored box with a text subnode. The boxes are showing up, not the labels. The label is changing, as shown in my print statement, but not visible. Here is my code:

| | | | local cnode\_tree = gui.clone\_tree(gui.get\_node(‘topicBtn’)) |
| --- | --- | --- | --- |
| | | | local cnode = cnode\_tree[hash(‘topicBtn’)] |
| | | | local tnode = cnode\_tree[hash(‘topicT’)] |
| | | | print('setting topic: '..top) |
| | | | print('old label: '..tostring(gui.get\_text(tnode))) |
| | | | gui.set\_text(tnode, top) |
| | | | print('new label: '..tostring(gui.get\_text(tnode))) |
| | | | gui.set\_position(cnode,vmath.vector3(512,500-idx\*82,0)) |
| | | | gui.set\_layer(cnode, ‘results’) |
| | | | gui.move\_above(tnode, cnode) |
| | | | gui.set\_enabled(tnode, true) |
| | | | gui.set\_visible(tnode, true) |

I am sure the last 3 are irrelevant, but just trying. The set\_text and get\_text are working, the label has the new text.

What am I forgetting?

---

<div class="post-metadata">

**Author:** ![Ideate\_Games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ideate_games/32/37678_2.png) [@Ideate\_Games](https://forum.defold.com/u/Ideate_Games)\
**Post date:** [October 8, 2024, 7:49pm UTC](https://forum.defold.com/t/clone-tree-label-not-showing/78380/2 "2024-10-08T19:49:22Z")

</div>

This works, but then the label is not attached to the box node.

| | | | local cnode\_tree = gui.clone\_tree(gui.get\_node(‘topicBtn’)) |
| --- | --- | --- | --- |
| | | | local cnode = cnode\_tree[hash(‘topicBtn’)] |
| | | | – local tnode = cnode\_tree[hash(‘topicT’)] |
| | | | local tnode = gui.clone(gui.get\_node(‘topicT’)) |
| | | | print(setting topic: ..top) |
| | | | print(old label: ..tostring(gui.get\_text(tnode))) |
| | | | gui.set\_text(tnode, top) |
| | | | print(new label: ..tostring(gui.get\_text(tnode))) |
| | | | gui.set\_position(cnode,vmath.vector3(512,768-idx\*82,0)) |
| | | | gui.set\_position(tnode,vmath.vector3(512,768-idx\*82,0)) |
| | | | gui.set\_layer(cnode, ‘results’) |
| | | | gui.set\_layer(tnode, ‘results’) |
| | | | gui.move\_above(tnode, cnode) |

---

<div class="post-metadata">

**Author:** ![Alex\_8BitSkull](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/alex_8bitskull/32/5424_2.png) [@Alex\_8BitSkull](https://forum.defold.com/u/Alex_8BitSkull)\
**Post date:** [October 8, 2024, 8:19pm UTC](https://forum.defold.com/t/clone-tree-label-not-showing/78380/3 "2024-10-08T20:19:36Z")

</div>

It’s not apparent to me right away, so if someone else has an idea do jump in!

Does the initial node tree look fine in the editor? Is the text node (tnode / topicT) a child of what I presume to be the box node (cnode / topicBtn)? Can you show the setup in the editor?

---

<div class="post-metadata">

**Author:** ![Ideate\_Games](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ideate_games/32/37678_2.png) [@Ideate\_Games](https://forum.defold.com/u/Ideate_Games)\
**Post date:** [October 9, 2024, 5:41pm UTC](https://forum.defold.com/t/clone-tree-label-not-showing/78380/4 "2024-10-09T17:41:36Z")

</div>

All of that was true as far as I know, I checked it several times. Not useful to show it now, as it has all been working fine since it started working. I have added dozens of nodes and all working fine. I assume this should be closed, I don’t know what I did differently.
