"setCheckable"
Sets if a node is checkable inside a tree widget.
Synopsis
shape.setCheckable(string id, bool checkable);
Parameter
Parameter | Description |
---|---|
shape | Name of the object. |
id | The ID of the tree item that should that should set the checkable option. |
checkable | Boolean value that defines wether a item is checkable or not checkable. |
Description
setCheckable allows to set a item in a tree widget to be checkable.
Example
In this example multiple items are added to a tree widget node (WHOLE NAME) and afterwards set checkable.
main()
{
//Add three columns
TREE1.addColumn("SURNAME");
TREE1.addColumn("FIRST NAME");
TREE1.addColumn("ADDRESS");
//append the item WHOLE NAME
TREE1.appendItemNC("","WHOLE NAME","WHOLE_NAME");
//append three leaves to WHOLE NAME
TREE1.appendItemNC("WHOLE NAME","MUELLER","Mueller");
TREE1.appendItemNC("WHOLE NAME","SCHMIDT","Schmidt");
TREE1.appendItemNC("WHOLE NAME","KAUFMANN","Kaufmann");
//Set the text for the leave node column "NAME"
TREE1.setText("MUELLER",1,"Maria");
TREE1.setText("SCHMIDT",1,"Anna");
TREE1.setText("KAUFMANN",1,"Jan");
//Set the text for the leave node column "ADDRESS"
TREE1.setText("MUELLER",2,"Hauptstr. 1");
TREE1.setText("SCHMIDT",2,"Wienerstr. 10");
TREE1.setText("KAUFMANN",2,"Nebenstr. 100");
//Set the checkable option for the items
TREE1.setCheckable("WHOLE NAME",true);
TREE1.setCheckable("MUELLER",true);
TREE1.setCheckable("SCHMIDT",true);
TREE1.setCheckable("KAUFMANN",true);
}
Assignment
Tree Widget