LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I duplicate a control in a subVI using the reference?

Here's what I want to do. I have a tree control in my main application. I add and delete items dynamically based on user input. If I pass my tree reference to a subVI, I can add, subtract and reorder the items in the tree and the changes are shown on the main tree. How can I duplicate the tree in the subVI? Would I simply pass the tree control in (which I'd rather not do) or is there some other way to accomplish this?
 
Thanks in advance for any help.
 
Gary
0 Kudos
Message 1 of 3
(3,711 Views)
Here's my attempt.  This VI uses a control reference of the old tree and generates a data structure that can be used by the "Edit Tree Items.Add Multiple Items to End" method to add contents to the new tree that should be identical to the contents of the original tree.  Note that this VI only works with LabVIEW 8.0 and later, since the afore-mentioned method is not available in previous versions.
 
I hope this helps...also note that I saw some re-draw issues with LabVIEW 8.0, i.e. after the VI ran, I didn't see the tree displayed properly until I minimized/restored the window, or dragged another window over it.  I did not see the redraw issues in LabVIEW 8.2.
 
-D
 
 
Message 2 of 3
(3,699 Views)

Thanks. This isn't quite what I was looking for but it does work. I was hoping there was a method or something to duplicate the tree in the subVI. this works though and a solution similar to this is probably what I'll have to live with. Thanks for the help.

Gary


@Darren wrote:
Here's my attempt.  This VI uses a control reference of the old tree and generates a data structure that can be used by the "Edit Tree Items.Add Multiple Items to End" method to add contents to the new tree that should be identical to the contents of the original tree.  Note that this VI only works with LabVIEW 8.0 and later, since the afore-mentioned method is not available in previous versions.
 
I hope this helps...also note that I saw some re-draw issues with LabVIEW 8.0, i.e. after the VI ran, I didn't see the tree displayed properly until I minimized/restored the window, or dragged another window over it.  I did not see the redraw issues in LabVIEW 8.2.
 
-D
 
 



 

0 Kudos
Message 3 of 3
(3,659 Views)