Tree View Values

Bob Sneidar bobsneidar at iotecdigital.com
Thu Aug 30 12:49:24 EDT 2018


Hi Brian. 

Actually for my purposes I need the last key of the array node. For example, if I have an array:

myArray [level1] [level2] [level3]

and the value is "Test1"

then I need to return an array:

aArrayNode [level3]

I worked it out using my method so I'm not asking for a modification to your method, this for informational purposes only. What I am actually creating is an XML editor using a tree view, and also I am creating a method for solving the Property Inspector issue some have raised, where clicking a tree node does not hilite the node name or the value if there is one. 

What I am doing is almost identical to what the the property inspector does. I've worked it out so that hiliting a tree node whose value is an array puts the name of the hilited node into the Key field, selects the text of the key field, and puts empty into the Value field. If however the value of the hilited node is a value, it puts the value into the Value field and selects the text of the value field. This IMHO is the way the property inspector *ought* to work. 

Bob S


> On Aug 30, 2018, at 07:41 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Oh there you go! That works.
> 
> Bob S
> 
> 
>> On Aug 29, 2018, at 13:58 , Brian Milby via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Here is another way to do it:
>> 
>> function getHilightedValue pTreeWidgetReference
>>  local tElement, tArray
>>  put the arrayData of pTreeWidgetReference into tArray
>>  put the hilitedElement of pTreeWidgetReference into tElement
>>  split tElement by comma
>>  return tArray[tElement]
>> end getHilightedValue




More information about the use-livecode mailing list