LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to change the type of a Tree cell

Solved!
Go to solution

Hello,

I'm using LABWINDOW CVI 2015, 

Starting from the xmlTree example, I have figured out that it is possible to set a cell in string:

SetTreeCellAttribute (panel, tree, ItemIndex, 0, ATTR_CELL_TYPE, VAL_CELL_RING);

In an other hand, the example event.prj show that the tree can be used with button, ring and combo_box (UI comming already formatted).

But my tests to put the cell programatically in an other type failed:

SetTreeCellAttribute (panel, tree, ItemIndex, 0, ATTR_CELL_TYPE, VAL_CELL_BUTTON); SetTreeCellAttribute (panel, tree, ItemIndex, 0, ATTR_CELL_TYPE, VAL_CELL_CHECK_BOX);

SetTreeCellAttribute (panel, tree, ItemIndex, 0, ATTR_CELL_TYPE, VAL_CELL_RING);
SetTreeCellAttribute (panel, tree, ItemIndex, 0, ATTR_CELL_TYPE, VAL_CELL_COMBO_BOX);

If someone has any idea?

Best regards,

 

Serge

0 Kudos
Message 1 of 6
(2,675 Views)
Solution
Accepted by topic author Zergios26

That's because you cannot modify the cell type of column 0,and you should receive an error like attribute value not valid doing so: check the return value from the function. It is always a good habit to test for errors when a function does not what we expect it to do.

Even passing VAL_ALL_OBJECTS to operate on all cells in a row the first column remains unchanged.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 6
(2,655 Views)

Thanks a lot, I was stucked on that.

Best regards,

Serge

0 Kudos
Message 3 of 6
(2,650 Views)

Hi again,

I was able to change the type of the tree cell following your instructions. But now I cant see how to change the value of a CHECK_BOX by program, how can I access the control inside the cell?

Any help would be great.

Best regards,

Serge

0 Kudos
Message 4 of 6
(2,606 Views)
Solution
Accepted by topic author Zergios26

Simply use Get/SetTreeCellAttribue with attribute ATTR_MARK_STATE.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 6
(2,600 Views)

Thank you very much

0 Kudos
Message 6 of 6
(2,596 Views)