7. Working with List Views and Tree Views : Treeview Fields : How You Can Attach Information to a Tree Node
 
Share this page                  
How You Can Attach Information to a Tree Node
Every class has an attribute, ClientData, of type Object. The ClientData attribute provides a convenient way to attach data to a tree node. In tree_example_2, the add_a_node method attaches a tree_ex2_class object to each tree node.
The tree_ex2_class has the following attributes:
fld
Specifies a formfield, the field that corresponds to the node
original_bgcolor
Specifies an integer, the original background color of the field
color_changed
Specifies an integer, a flag to indicate that the background color was changed
The fld attribute allows access to the field on the frame sample_frame. How You Can Use Bitmap Labels (see How You Can Use Bitmap Labels) shows how the other two attributes are used.