LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add control as Tree Item

I'm wondering if there is a way to add control such as a push botton to a tree. Seems like you can only add String to a tree. I'm using Labview 7.1
 
Thanks
0 Kudos
Message 1 of 2
(2,695 Views)

Hello,

There is no way to add an actual button to a tree, but you can add glyphs to tree items, and monitor the tree for clicks and make the glyphs behave like buttons.  I took this approach in the VI Analyzer, where I have checkbox glyphs next to each tree tag in one of my trees, and when you click the glyph it changes from checked to unchecked (and vice-versa).  The code for this was not trivial.  If you are using LabVIEW 7.1 or earlier, you will need to use the Point to Row-Col.vi in vi.lib\tree.  If you are using LabVIEW 8.0, there is actually a Point to Row-Col method on the tree that you can use along with a Mouse Down event on the tree to change the glyph when the user clicks on the tree and the click is within the bounds of the glyph.

Hope this helps you get started.  Good luck,

-D

0 Kudos
Message 2 of 2
(2,690 Views)