GTK+
The GIMP Toolkit

General
Introduction
Screenshots
Download
Mailing Lists
Language Bindings
Themes
Bug Tracker

Documentation
FAQ
Tutorial
API Reference
Published Books

Projects
Pango
Inti
GNOME
GTK+ for Win32
GtkFB (Framebuffer)
GTK+ on DirectFB
GTK+ for BeOS

Applications
GIMP
Abiword
Dia
Glade
GnuCash
Gnumeric

GNOME Software Map

12.3. Setting CTree Attributes

There are a number of functions 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:

void gtk_ctree_set_indent( GtkCTree *ctree, 
                           gint      indent );

void gtk_ctree_set_spacing( GtkCTree *ctree, 
                            gint      spacing );

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

The function gtk_ctree_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 functions affect the style of the lines and expander that are drawn to represent the tree structure. An expander is a grpahical component that the user can select to expand and collapse a branch of the tree.

void gtk_ctree_set_line_style( GtkCTree          *ctree, 
                               GtkCTreeLineStyle  line_style );

void gtk_ctree_set_expander_style( GtkCTree              *ctree, 
                                   GtkCTreeExpanderStyle  expander_style );

The function gtk_ctree_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:

 GTK_CTREE_LINES_NONE
 GTK_CTREE_LINES_SOLID
 GTK_CTREE_LINES_DOTTED
 GTK_CTREE_LINES_TABBED

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

 GTK_CTREE_EXPANDER_NONE
 GTK_CTREE_EXPANDER_SQUARE
 GTK_CTREE_EXPANDER_TRIANGLE
 GTK_CTREE_EXPANDER_CIRCULAR