Close nodes in Tree View widget

andrew at midwestcoastmedia.com andrew at midwestcoastmedia.com
Thu Jun 14 10:33:02 EDT 2018


Thank you!
https://quality.livecode.com/show_bug.cgi?id=21361

--Andrew Bell


Quoting Brian Milby <brian at milby7.com>:

> Could you open a bug report/enhancement request for this? I’ll see  
> what I can do about a PR targeting 9.1 release.
>
> I can think of several ways to address the situation. Easiest would  
> be to reset the array that handles what is expanded when the data  
> array is changed. Would not be hard to add a separate handler to  
> collapse all nodes.
>
> Once done, you could pull the updated source and compile/use locally  
> until it makes it into a release.
>
> Thanks,
> Brian
> On Jun 14, 2018, 8:43 AM -0500, Andrew Bell via use-livecode  
> <use-livecode at lists.runrev.com>, wrote:
>> Setting the arrayData to EMPTY acts the same as setting the arrayData
>> to some other array: the open nodes remain open. I even tried changing
>> the number of elements in the array to something as low as 1 but it
>> still remembered what nodes had been open when setting the arrayData
>> to something with more elements.
>>
>> There are no properties in the dictionary that describe this type of
>> operation. The closest I could find was hilitedElement but that
>> doesn't actually open or close a node leaf. In fact, if you set the
>> hilitedElement to a node that isn't open it will hilite the next node
>> that is open instead. (bug?)
>>
>> This isn't critical for this project as it is just an internal tool
>> that only I use, but the only workaround I could come up with is to
>> delete the widget and then create the widget again via script along
>> with all the attributes.
>>
>> --Andrew Bell
>>
>>
>> > Date: Wed, 13 Jun 2018 23:02:52 +0100
>> > From: Alex Tweedly <alex at tweedly.net>
>> > Subject: Re: Close nodes in Tree View widget
>> >
>> > I can't try it out right now - but would it be any good to set the
>> > arraydata to empty, and then load the new values you want ? That might
>> > (effectively) delete and recreate the relevant nodes, and thereby reset
>> > the status of the leaf nodes.
>> >
>> > Alex.
>> >
>>
>>
>>
>>
>> _______________________________________________
>> 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