docs: [Treeveiw Example not working] #125

Open
opened 2025-01-01 12:36:54 +08:00 by JV-lab-create · 0 comments
JV-lab-create commented 2025-01-01 12:36:54 +08:00 (Migrated from github.com)

** Where? **

In the example in the "Treeview" section I got a error.
image

** Possible solution **

I tried to use the example on the "onSelect" event it worked until clicked on the "Child Node" but it showed this error.
image

** My Code**

Code I used for example 1
image

Code I used for example 2

image

** What I found out **

From me testing it seems like that this was the problem:

childNode.onSelect(function(self)
    basalt.debug("Node selected:", self.getText()) 
end)

The self.getText() was making the error come it says that

attempt to call method 'getText' (a nil value)

** Checklist **

### ** Where? ** In the example in the "Treeview" section I got a error. ![image](https://github.com/user-attachments/assets/a7032bf7-d425-4cd3-85de-f92e563b229b) ### ** Possible solution ** I tried to use the example on the "onSelect" event it worked until clicked on the "Child Node" but it showed this error. ![image](https://github.com/user-attachments/assets/1b63ac54-217d-4c8f-839d-89895705a277) ### ** My Code** Code I used for example 1 ![image](https://github.com/user-attachments/assets/a880b90d-bcd3-4804-bfb4-c6eca7991a0b) ### Code I used for example 2 ![image](https://github.com/user-attachments/assets/142f9f22-9374-4eb5-8497-357ced5c6e09) ### ** What I found out ** From me testing it seems like that this was the problem: ``` childNode.onSelect(function(self) basalt.debug("Node selected:", self.getText()) end) ``` The `self.getText()` was making the error come it says that > attempt to call method 'getText' (a nil value) ### ** Checklist ** - [X] I am looking at the latest version of the docs. - [x] I am using CraftOS 1.8 because i am using CC: Restitched (https://www.curseforge.com/minecraft/mc-mods/cc-restitched).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GitHub/Basalt#125
No description provided.