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:
ctree.set_indent(indent)
ctree.set_spacing(spacing)
|
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.
ctree.set_line_style(line_style)
ctree.set_expander_style(expander_style)
|
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:
CTREE_LINES_NONE
CTREE_LINES_SOLID
CTREE_LINES_DOTTED
CTREE_LINES_TABBED
|
The method set_expander_style()
is used to select the style of branch expander, and the parameter expander_style
can be one of:
CTREE_EXPANDER_NONE
CTREE_EXPANDER_SQUARE
CTREE_EXPANDER_TRIANGLE
CTREE_EXPANDER_CIRCULAR
|