Close nodes in Tree View widget
brian at milby7.com
Thu Jun 14 09:54:05 EDT 2018
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.
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:
More information about the Use-livecode