Show Tree widget row contents on hover?

Keith Clarke keith.clarke at me.com
Fri Apr 23 15:33:10 EDT 2021


Thanks Bob for the syntax for setting the widget’s tooltip. That’ll help once I have some sensible data appearing in the answer dialogue box that I can use in the tooltip.

My key problem now is how to translate the comma-delimited path returned by the actionInspect function - pPath - of the form 'Key1,Key2,Key3' …to the correct syntax to have the array return the content of Key3.

My code below converts pPath to LiveCode array key syntax, i.e. [Key1][Key2][Key3] ...and then concatenates this after aContent, the name of the array variable into which the widget’s arrayData has been extracted.

As far as I can tell, this should resolve to... answer aContent[Key1][Key2][Key3] ...which should return the content of Key3 but I’m seeing '[Key1][Key2][Key3]’ in the answer dialogue box.

Any clues?
Best,
Keith

> On 23 Apr 2021, at 19:17, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Okay I see you are setting the tooltip. 
> 
> set the tooltip of widget "Tree View" to tDataA [1]
> 
> or whatever the element is. 
> 
> Bob S
> 
> 
>> On Apr 23, 2021, at 11:13 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Is this what you are looking for? 
>> 
>> on mouseUp
>>  put the arrayData of widget "Tree View" into tDataA
>>  put tDataA [1] into tValue1
>>  put tDataA [2] into tValue2
>>  -- etc...
>> end mouseUp
>> 
>> I am unsure of what you are trying to do. Are you trying to put the items of a list into a tree view widget? 
>> 
>> put the arrayData of widget "Tree View" into tDataA
>> put item 1 of tList into tDataA [1]
>> put item 2 of tList into tDataA [2]
>> -- etc...
>> set the arrayData of widget "Tree View" to tDataA
>> 
>> you can do this in a loop of course. 
>> 
>> Bob S
>> 
>> 
>>> On Apr 23, 2021, at 10:57 , Keith Clarke via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>>> Thanks for responding Henry. 
>>> 
>>> I did try that property when I found no hover capability on the Tree widget. I set the widget to read-only and scripted...
>>> on actionInspect pPath
>>> 
>>> 	put the arrayData of widget "Tree" into aContent
>>> 
>>> 	replace comma with "][" in pPath
>>> 
>>> 	answer aContent & "[" & pPath & "]"
>>> 
>>> end actionInspect
>>> 
>>> …however, like the highlightedElement property, this still returns the element’s key rather than its content, despite my feeble attempts at post-processing.
>>> 
>>> Hence the second part of my question which reveals my lack of array syntax knowledge! :)
>>> Best,
>>> Keith  
>> 
>> _______________________________________________
>> 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





More information about the use-livecode mailing list