Gtk-- Reference: Gtk::CTree

Class Index | Cross Index | Namespace Index

# Class Gtk::CTree

A widget displaying a hierarchical tree.
Contained in: Gtk
Derived from: Gtk::CList
Derived by: none

#include <gtk--/ctree.h>

### public function member index:
`` | `CTree` | `(`const` `SArray`& `titles`, `gint` `tree_column`=0)`;
`` | `CTree` | `(`gint` `columns`, `gint` `tree_column`=0)`;
``GtkCTree`*` | `gtkobj` | `()`;
``const` `GtkCTree`*` | `gtkobj` | `() `const``;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
``bool`` | `is_hot_spot` | `(`gint` `x`, `gint` `y`)`;
`Row` | `row` | `(`int` `i`)`;
``const` Row` | `row` | `(`int` `i`) `const``;
`RowList` | `rows` | `()`;
``const` RowList` | `rows` | `() `const``;
``SelectionList`&` | `selection` | `()`;
``const` `SelectionList`&` | `selection` | `() `const``;
``void`` | `set_drag_compare_func` | `(CompareDragFunc `p0`)`;
``void`` | `set_expander_style` | `(ExpanderStyle `style`)`;
``void`` | `set_indent` | `(`gint` `indent`)`;
``void`` | `set_line_style` | `(LineStyle `style`)`;
``void`` | `set_show_stub` | `(`bool` `show_stub`)`;
``void`` | `set_spacing` | `(`gint` `spacing`)`;
`TreeList` | `tree` | `()`;
``const` TreeList` | `tree` | `() `const``;
``signal` `void`` | `tree_collapse` | `(Row)`;
``signal` `void`` | `tree_expand` | `(Row)`;
``signal` `void`` | `tree_select_row` | `(Row, `gint`)`;
``signal` `void`` | `tree_unselect_row` | `(Row, `gint`)`;
``virtual`` | `~CTree` | `()`;
### protected function member index:
``virtual` `void`` | `tree_collapse_impl` | `(Row `row`)`;
``virtual` `void`` | `tree_expand_impl` | `(Row `row`)`;
``virtual` `void`` | `tree_select_row_impl` | `(Row `row`, `gint` `column`)`;
``virtual` `void`` | `tree_unselect_row_impl` | `(Row `row`, `gint` `column`)`;

## Description:

The `Gtk::CTree` widget is used for showing a hierarchical tree to the user, for example a directory tree.

The tree is internally represented as a set of ``GtkCTreeNode`` structures.

The interface has much in common with the `Gtk::CList` widget: rows (nodes) can be selected by the user etc.

Positions in the tree are often indicated by two arguments, a parent and a sibling, both ``GtkCTreeNode`` pointers. If the parent is NULL, the position is at the root of the tree and if the sibling is NULL, it will be the last child of parent, otherwise it will be inserted just before the sibling.

## Function Member Descriptions:

Gtk::CTree::CTree - Create tree with titles.

`` `CTree``(`const` `SArray`& `titles`, `gint` `tree_column`=0)`;
Gtk::CTree::CTree - Create tree without titles.

`` `CTree``(`gint` `columns`, `gint` `tree_column`=0)`;
Gtk::CTree::gtkobj - Returns the underlaying gtk+ object.

``GtkCTree`*` `gtkobj``()`;
Gtk::CTree::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::CTree::is_hot_spot - Used to determine if a particular coordinat lies on an expander button.

``bool`` `is_hot_spot``(`gint` `x`, `gint` `y`)`;

> x, y: The coordinates to check. Returns: True if the given coordinates lie on an expander button.

Gtk::CTree::set_indent - Set the amount of indentation between levels in the tree.

``void`` `set_indent``(`gint` `indent`)`;

> indent: The number of pixels to the levels of the tree.

Gtk::CTree::set_spacing - Set the spacing between the tree graphic and the actual node content.

``void`` `set_spacing``(`gint` `spacing`)`;

> spacing: The number of pixels between the tree and the node's content.