LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get position of a ring in a tree control?

Solved!
Go to solution

Ok, this is probably a stupid question, but how does one get the position of a ring inside of a tree control?  I have a tree with two columns, with rings in the second column.  I can set the position using SetTreeCellRingValueFromIndex(), but how does one get the position after the user has modified the control?  I found the functions GetTreeCellRingIndexFromValue() and GetTreeCellRingValueFromIndex() but I haven't found a way to get either the Index or the Value of the ring (what I'm looking for is the index, but if I can obtain the value I can go from there).  Thanks in advance!

0 Kudos
Message 1 of 5
(4,195 Views)

Hi,

 

You can use GetTableCellVal function to get the value of the ring.

There is not special "ring" function for that. Maybe that's what you were searching for 😉

 

From the value you can get to the index using the functions you are already aware of.

 

Hope this helps,

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 5
(4,178 Views)

Hi,

 

Thanks for the reply.  I believe that function is for a Table control.  I tried it on the Tree control anyway, and I get an error of -10 "The control is not the type expected by the function.".

 

I'm still stumped on this.  I tried looking through the examples, hoping to find a Tree example that uses rings, but none of them do.  Seems like I must be missing something obvious.

0 Kudos
Message 3 of 5
(4,165 Views)
Solution
Accepted by topic author tstanley

You can get the value of the tree cell by GetTreeCellAttribute(ATTR_LABEL_TEXT). Then, as you noted, you can use GetTreeCellRingIndexFromValue() to get the index.

 

Hope this helps.

 

- jared

Message 4 of 5
(4,143 Views)

Hi,

 

Using ATTR_LABEL_TEXT works.  I guess thinking of the ring value as the label text didn't seem intuitive for me.  Thanks!

0 Kudos
Message 5 of 5
(4,137 Views)