1
<!-- ##### SECTION Title ##### -->
4
<!-- ##### SECTION Short_Description ##### -->
7
<!-- ##### SECTION Long_Description ##### -->
11
#GtkTree is deprecated and unsupported. It is known to be
12
buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN
13
prior to including the GTK+ header files. Use #GtkTreeView instead.
16
The #GtkTree widget is a container that shows users a list of items, in a tree format complete with branches and leafnodes. Branches can be expanded to show their child items, or collapsed to hide them.
19
<!-- ##### SECTION See_Also ##### -->
21
#GtkTreeList for the items to put into a #GtkTree.
24
#GtkScrolledWindow for details on how to scroll around a #GtkTree.
27
<!-- ##### SECTION Stability_Level ##### -->
30
<!-- ##### STRUCT GtkTree ##### -->
35
GtkContainer container;
37
GtkTree* root_tree; /* owner of selection list */
38
GtkWidget* tree_owner;
43
guint selection_mode : 2;
51
<!-- ##### SIGNAL GtkTree::select-child ##### -->
53
This signal is emitted by @tree whenever @widget is about to be selected.
56
@tree: the object which received the signal.
57
@widget: The child that is about to be selected.
59
<!-- ##### SIGNAL GtkTree::selection-changed ##### -->
61
This signal is emitted by the root tree whenever the selection changes.
64
@tree: the object which received the signal.
66
<!-- ##### SIGNAL GtkTree::unselect-child ##### -->
68
This signal is emitted by @tree whenever @widget is about to be unselected.
71
@tree: the object which received the signal.
72
@widget: The child that is about to be unselected.
74
<!-- ##### MACRO GTK_IS_ROOT_TREE ##### -->
76
A macro that returns a boolean value which indicates if @obj is a root tree or not.
79
@obj: A pointer to the #GtkTree. @obj will accept any pointer, but if the pointer does not point to a #GtkTree, the results are undefined.
82
<!-- ##### MACRO GTK_TREE_ROOT_TREE ##### -->
84
A macro that returns the root tree of @obj.
87
If @obj is already a root tree, @obj is cast to #GtkTree and returned.
90
@obj: A pointer to the #GtkTree. @obj will accept any pointer, but if the pointer does not point to a #GtkTree, the results are undefined.
93
<!-- ##### MACRO GTK_TREE_SELECTION_OLD ##### -->
101
<!-- ##### ENUM GtkTreeViewMode ##### -->
109
<!-- ##### FUNCTION gtk_tree_new ##### -->
111
Creates a new #GtkTree.
114
@Returns: A pointer to the newly allocated widget.
117
<!-- ##### FUNCTION gtk_tree_append ##### -->
119
Adds the #GtkTreeItem in @tree_item to the end of the items in @tree.
122
@tree: A pointer to a #GtkTree.
123
@tree_item: A pointer to the #GtkWidget that is to be appended to the tree.
126
<!-- ##### FUNCTION gtk_tree_prepend ##### -->
128
Adds the #GtkTreeItem in @tree_item to the start of the items in @tree.
131
@tree: A pointer to a #GtkTree.
132
@tree_item: A pointer to the #GtkWidget that is to be prepended to the tree.
135
<!-- ##### FUNCTION gtk_tree_insert ##### -->
137
Adds the #GtkTreeItem in @tree_item to the list of items in @tree at the position indicated by @position.
140
@tree: A pointer to a #GtkTree.
141
@tree_item: A pointer to the #GtkWidget that is to be added to the tree.
142
@position: A #gint that indicates the position in the tree, that the @tree_item is to be added at.
145
<!-- ##### FUNCTION gtk_tree_remove_items ##### -->
147
Removes a list of items from the #GtkTree in @tree.
150
If only one item is to be removed from the #GtkTree, gtk_container_remove() can be used instead.
153
Removing an item from a #GtkTree dereferences the item, and thus usually destroys the item and any subtrees it may contain. If the item is not to be destroyed, use g_object_ref() before removing it.
156
@tree: A pointer to a #GtkTree.
157
@items: A pointer to a #GList that contains the items to be removed.
160
<!-- ##### FUNCTION gtk_tree_clear_items ##### -->
162
Removes the items at positions between @start and @end from the #GtkTree @tree.
165
Removing an item from a #GtkTree dereferences the item, and thus usually destroys the item and any subtrees it may contain. If the item is not to be destroyed, use g_object_ref() before removing it.
168
@tree: A pointer to a #GtkTree.
173
<!-- ##### FUNCTION gtk_tree_select_item ##### -->
175
Emits the #select_item signal for the child at position @item, and thus selects it (unless it is unselected in a signal handler).
178
@tree: A pointer to a #GtkTree.
182
<!-- ##### FUNCTION gtk_tree_unselect_item ##### -->
184
Emits the #unselect_item for the child at position @item, and thus unselects it.
187
@tree: A pointer to a #GtkTree.
191
<!-- ##### FUNCTION gtk_tree_select_child ##### -->
193
Emits the #select_item signal for the child @tree_item, and thus selects it (unless it is unselected in a signal handler).
196
@tree: A pointer to a #GtkTree.
197
@tree_item: A pointer to the #GtkWidget that is to be selected.
200
<!-- ##### FUNCTION gtk_tree_unselect_child ##### -->
202
Emits the #unselect_item signal for the child @tree_item, and thus unselects it.
205
@tree: A pointer to a #GtkTree.
206
@tree_item: A pointer to the #GtkWidget that is to be selected.
209
<!-- ##### FUNCTION gtk_tree_child_position ##### -->
211
Returns the position of @child in the #GtkTree @tree.
214
If @child is not a child of @tree, then -1 is returned.
217
@tree: A pointer to a #GtkTree.
218
@child: A pointer to a #GtkWidget.
222
<!-- ##### FUNCTION gtk_tree_set_selection_mode ##### -->
224
Sets the selection mode for the #GtkTree @tree.
232
%GTK_SELECTION_SINGLE for when only one item can be selected at a time.
237
%GTK_SELECTION_BROWSE for when one item must be selected.
242
%GTK_SELECTION_MULTIPLE for when many items can be selected at once.
247
%GTK_SELECTION_EXTENDED Reserved for later use.
252
The selection mode is only defined for a root tree, as the root tree "owns" the selection.
255
The default mode is %GTK_SELECTION_SINGLE.
258
@tree: A pointer to a #GtkTree.
259
@mode: A #GtkSelectionMode.
262
<!-- ##### FUNCTION gtk_tree_set_view_mode ##### -->
264
Sets the 'viewmode' for the #GtkTree in @tree. The 'viewmode' defines how the tree looks when an item is selected.
272
%GTK_TREE_VIEW_LINE : When an item is selected the entire #GtkTreeItem is highlighted.
277
%GTK_TREE_VIEW_ITEM : When an item is selected only the selected item's child widget is highlighted.
282
The default mode is %GTK_TREE_VIEW_LINE.
285
@tree: A pointer to a #GtkTree.
286
@mode: A #GtkTreeViewMode.
289
<!-- ##### FUNCTION gtk_tree_set_view_lines ##### -->
291
Sets whether or not the connecting lines between branches and children are drawn.
294
@tree: A pointer to a #GtkTree.
295
@flag: A #guint, indicating %TRUE, or %FALSE.
298
<!-- ##### FUNCTION gtk_tree_remove_item ##### -->
300
Removes the item @child from the #GtkTree @tree.
303
@tree: A pointer to a #GtkTree.
304
@child: A pointer to the #GtkWidget that is to be removed from the tree.