12.3. Setting CTree Attributes

There are a number of methods that set options that pertain to a CTree instance as a whole (rather than to a particular node). The first group set padding attributes that effect how the widget is drawn:


The method set_indent() sets how far a new branch is indented in relation to it's parent. The default is 20.

The method set_spacing() sets how far a node is horizontally padded from the vertical line that is drawn linking the nodes of each branch. The default is 5.

The next two methods affect the style of the lines and expander that are drawn to represent the tree structure. An expander is a graphical component that the user can select to expand and collapse a branch of the tree.


The method set_line_style() is used to select the style of line that is drawn between nodes of the tree. The parameter line_style can be one of:

The method set_expander_style() is used to select the style of branch expander, and the parameter expander_style can be one of: