07-27-2021 01:05 AM
Hi,
I am using Tree control.
Normally, the tree gives out the tags of selected items. However, If I select one item and then delete it, the tree output doesn't change. See attached please. Thanks.
LV2019sp1, win 10
WT
Solved! Go to Solution.
07-27-2021 04:19 AM
That's a bug alright...
I can confirm this on LV20, 64 bit.
Instructions:
+ Select an item
+ Run VI
+ Notice the value in the array
+ Delete the selected item
+ Run VI
+ Notice the value is still in the array
Is this just an edit time problem? Selecting another item fixes the problem.
If this is a problem during execution, I suppose there are ways around it. We'd need a specific use case though.
07-27-2021 08:57 AM
Thanks for your comments.
I found a temporary solution by following a property setting “ Reinitial to default”.
07-27-2021 11:18 AM
@weitong wrote:
Thanks for your comments.
I found a temporary solution by following a property setting “ Reinitial to default”.
I think this could help me!
07-28-2021 02:57 AM
I'd probably just set the value with a property node.
Maybe even a value (signaling), if there's an event attached to it.
07-28-2021 09:31 AM
wiebe@CARYA wrote:
I'd probably just set the value with a property node.
Maybe even a value (signaling), if there's an event attached to it.
I think I actually tried this before and it didn't work right. But it was very long ago.
07-28-2021 10:34 AM
@billko wrote:
wiebe@CARYA wrote:
I'd probably just set the value with a property node.
Maybe even a value (signaling), if there's an event attached to it.
I think I actually tried this before and it didn't work right. But it was very long ago.
Works for me in LV20.
07-28-2021 04:07 PM
Maybe I can revisit that software. It was the first - and last - time I used a tree control and I was disappointed with it, to tell the truth.
07-29-2021 02:39 AM
@billko wrote:
Maybe I can revisit that software. It was the first - and last - time I used a tree control and I was disappointed with it, to tell the truth.
It's a wild beast to tame.
A tree and a subpanel showing the selected item, and item specific right click menus, can replace very complex alternatives. For some applications, there's really no substitute.
The API isn't exactly intuitive, but I'd almost always wrap things in a class anyway.
Especially custom drag and drop functionality is not as easy as it should be. The moment you catch one drag and drop event, you need to handle all drag and drop events. But this is the same for listboxes.
07-29-2021 02:40 PM
I think I was most disappointed that the names weren't namespaced. If the same name occurred ANYWHERE in the tree it gives it a new tag name, which complicated the code somewhat. It wasn't as elegant as I had hoped it would be. I was hoping to use it to duplicate a CLI command tree.