Page 1 of 1

Tree View texts dissapear

Posted: Mon Jun 26, 2017 10:50 am
by wfr
Hello Forum,

I am working with LV 1.8.4 and I am a really new here.

#####
If I try to fill the TreeView with the following code, then the text "myHouse" dissapears
on mouseUp
put "My House" into mydata[1]
put "Window" into mydata[1] [1]
set the ArrayData of widget "Tree_View_1" to myData
end mouseUp

#####
If I try to fill the TreeView with the following code, then the text "Window" dissapears

on mouseUp
put "Window" into mydata[1] [1]
put "My House" into mydata[1]
set the ArrayData of widget "Tree_View_1" to myData
end mouseUp


#####
If you do the same in the Code Insoector, the samme Error? occurs.


What is going on there???

wfr

Re: Tree View texts dissapear

Posted: Mon Jun 26, 2017 12:23 pm
by Klaus
Hi wfr,

1. welcome to the forum! :D

2. You simply overwrite the content of -> mydata{1} in both cases!
As you can see, even in your first example "My house" never appears in the the array and tree-view widget since it also got overwritten.

But the order of your commands is different (and important as we can see here), thus the result (disappearing "My House" string.


Best

Klaus

P.S.
Will mobe this thread to the beginner section, since there is definitively no relation to EXTERNALS or PLUGINS! 8)

Re: Tree View texts dissapear

Posted: Mon Jun 26, 2017 12:41 pm
by Klaus
After a second thought, may be you actually want something like this:

Code: Select all

on mouseUp
   put "Window" into mydata["My House"]["Livingroom"][1]
   put "Door" into mydata["My House"]["Livingroom"][2]
   set the ArrayData of widget 1 to myData
end mouseUp
?

Would make more sense, at least to me. :D