05-13-2020 07:50 AM
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
Solved! Go to Solution.
05-13-2020 08:55 AM
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.
05-13-2020 09:04 AM
05-14-2020 12:46 AM
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
05-14-2020 01:48 AM - edited 05-14-2020 01:49 AM
Simply use Get/SetTreeCellAttribue with attribute ATTR_MARK_STATE.
05-14-2020 02:15 AM
Thank you very much