tree view widget

J. Landman Gay jacque at hyperactivesw.com
Tue May 17 15:32:43 EDT 2016


The array is malformed. The script should be:

on mouseUp
   put "Dog,Cat,Horse" into temp
   repeat with i = 1 to the number of items of temp
     put item i of temp into tHobby["John"]["Animal"][i]
   end repeat
   put "Dog,Tortoise" into temp
   repeat with i = 1 to the number of items of temp
     put item i of temp into tHobby["Jane"]["Animal"][i]
   end repeat
   put  "Football,Swimming" into temp
   repeat with i = 1 to the number of items of temp
     put item i of temp into tHobby["Willy"]["Sport"][i]
   end repeat
   set the arraydata of widget "Tree View" to tHobby
end mouseUp

Note the square brackets around each sublevel.


On 5/17/2016 2:12 PM, Yves COPPE wrote:
> Hi,
>
> here is a sample of script (doesn’t work)
>
>
> on mouseUp
>
> put "Dog,Cat,Horse" into temp
>
> repeat with i = 1 to the number of items of temp
>
> put item i of temp into tHobby["John","Animal",i]
>
> end repeat
>
>
> put "Dog,Tortoise" into temp
>
> repeat with i = 1 to the number of items of temp
>
> put item i of temp into tHobby["Jane","Animal",i]
>
> end repeat
>
>
> put  « Football Swimming  into temp
>
> repeat with i = 1 to the number of items of temp
>
> put item i of temp into tHobby["Willy","Sport",i]
>
> end repeat
>
> set the arraydata of widget "MyTreeView" to tHobby
>
> end mouseUp
>
>> Le 17 mai 2016 à 10:48, Ali Lloyd <ali.lloyd at livecode.com> a écrit :
>>
>> That should work, yes! Could you post more than just the one-line snippet?
>> That way me might be able to see what is going wrong.
>>
>> On Mon, May 16, 2016 at 9:23 PM Yves COPPE <yvescoppe at mac.com> wrote:
>>
>>> Hi list,
>>>
>>> Let say I have an array  two dimensional created in a script
>>> this array has a name : MyContents
>>>
>>>
>>> How can i set the arrayData to the tree widget ?
>>>
>>> set the arrayData of widget  « X »  to MyContents ??       doesn’t work ...
>>>
>>> Thanks
>>>
>>> Greetings.
>>>
>>>> Le 16 mai 2016 à 17:41, Ali Lloyd <ali.lloyd at livecode.com> a écrit :
>>>>
>>>> There were several fixes applied to the custom properties editor which is
>>>> very similar-it appears we (I) forgot to also apply them to the array
>>>> editor. This is very easily rectified. Sorry for any inconvenience.
>>>>
>>>> On Sun, May 15, 2016 at 9:30 PM Dave Kilroy <dave at applicationinsight.com
>>>>
>>>> wrote:
>>>>
>>>>> Talk about buggy - my last posting had so many typos I'm doing it again:
>>>>>
>>>>> ------
>>>>>
>>>>> Yeah that inspector is buggy.
>>>>>
>>>>> I think the  'Key:' and 'Value:' properties are only for when you are
>>> using
>>>>> the inspector to add or update elements to it
>>>>>
>>>>> If you click the "+ Add new element" button at the top of the
>>> 'Arraydata'
>>>>> property field, then highlight the new key in the 'Arraydata' field,
>>> then
>>>>> click in the 'Value:' field and write something followed by pressing the
>>>>> tab
>>>>> or return key then the value will appear in 'Arraydata'.
>>>>>
>>>>> But quite a lot of the time the 'Key:' field is of no use (the hilited
>>> key
>>>>> in the 'Arraydata' field always seems to over-ride anything in the
>>> 'Key:'
>>>>> field). And the inspector seems to be unable to accept data for
>>>>> multi-dimensional arrays.
>>>>>
>>>>> Much easier to use script to populate the widget's arrayData property.
>>>>>
>>>>> One other thing to note is that the hilitedElement returns the key with
>>> a
>>>>> trailing comma so in script I have to do something like:
>>>>>
>>>>>   put the hilitedElement of me into tKey
>>>>>   if char -1 of tKey is comma then delete char -1 of tKey
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> "The first 90% of the task takes 90% of the time, and the last 10% takes
>>>>> the other 90% of the time."
>>>>> Peter M. Brigham
>>>>> --
>>>>> View this message in context:
>>>>>
>>> http://runtime-revolution.278305.n4.nabble.com/tree-view-widget-tp4704705p4704712.html
>>>>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> use-livecode at lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list