Re: Close nodes in Tree View widget

2018-06-14 Thread Andrew Bell via use-livecode

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

--Andrew Bell


Quoting Brian Milby :

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  
, 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 
> 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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Close nodes in Tree View widget

2018-06-14 Thread Brian Milby via use-livecode
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 
, 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 
> > 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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Close nodes in Tree View widget

2018-06-14 Thread Andrew Bell via use-livecode
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 
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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Close nodes in Tree View widget

2018-06-13 Thread Alex Tweedly via use-livecode
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.


On 13/06/2018 19:13, Andrew Bell via use-livecode wrote:
I'm working with the Tree View widget and have found that leaf nodes 
stay open even after the arrayData has changed. For example, if I 
click on leaf node 2 and 4 to open them up for further inspection but 
then load new arrayData those same leaf nodes are already expanded 
with the new data.


Is there a way via code to close all the leaf nodes, or to restrict 
the widget so only 1 node can be open at a time?


--Andrew Bell


___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Close nodes in Tree View widget

2018-06-13 Thread Andrew Bell via use-livecode
I'm working with the Tree View widget and have found that leaf nodes  
stay open even after the arrayData has changed. For example, if I  
click on leaf node 2 and 4 to open them up for further inspection but  
then load new arrayData those same leaf nodes are already expanded  
with the new data.


Is there a way via code to close all the leaf nodes, or to restrict  
the widget so only 1 node can be open at a time?


--Andrew Bell


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode