Tree View texts dissapear

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
wfr
Posts: 1
Joined: Mon Jun 26, 2017 9:34 am

Tree View texts dissapear

Post by wfr » Mon Jun 26, 2017 10:50 am

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

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tree View texts dissapear

Post by Klaus » Mon Jun 26, 2017 12:23 pm

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)

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tree View texts dissapear

Post by Klaus » Mon Jun 26, 2017 12:41 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”