TreeStore
Object Hierarchy:
Description:
[
CCode ( type_id =
"gtk_tree_store_get_type ()" ) ]
public class TreeStore :
Object,
Buildable,
TreeDragDest,
TreeDragSource,
TreeModel,
TreeSortable
The TreeStore object is a list model for use with a TreeView
widget.
It implements the TreeModel interface, and consequently, can use all of the methods
available there. It also implements the TreeSortable interface so it can be sorted
by the view. Finally, it also implements the tree drag and drop interfaces.
GtkTreeStore as GtkBuildable
The GtkTreeStore implementation of the Buildable interface allows to specify the model
columns with a <columns> element that may contain multiple <column> elements, each specifying one model column. The “type”
attribute specifies the data type for the column.
An example of a UI Definition fragment for a tree store:
<object class="GtkTreeStore">
<columns>
<column type="gchararray"/>
<column type="gchararray"/>
<column type="gint"/>
</columns>
</object>
Content:
Creation methods:
Methods:
- public void @set (TreeIter iter, ...)
Sets the value of one or more cells in the row referenced by iter
.
- public void append (out TreeIter iter, TreeIter? parent)
Appends a new row to this.
- public void clear ()
Removes all rows from this
- public void insert (out TreeIter iter, TreeIter? parent, int position)
Creates a new row at position
.
- public void insert_after (out TreeIter iter, TreeIter? parent, TreeIter? sibling)
Inserts a new row after sibling
.
- public void insert_before (out TreeIter iter, TreeIter? parent, TreeIter? sibling)
Inserts a new row before sibling
.
- public void insert_with_values (out TreeIter iter, TreeIter? parent, int position, ...)
Creates a new row at position
.
- public void insert_with_valuesv (out TreeIter iter, TreeIter? parent, int position, int[] columns, Value[] values)
A variant of
insert_with_values which takes the columns and values as two
arrays, instead of varargs.
- public bool is_ancestor (TreeIter iter, TreeIter descendant)
Returns true if iter
is an
ancestor of descendant
.
- public int iter_depth (TreeIter iter)
Returns the depth of iter
.
- public bool iter_is_valid (TreeIter iter)
WARNING: This function is slow.
- public void move_after (ref TreeIter iter, TreeIter? position)
Moves iter
in this to the
position after position
.
- public void move_before (ref TreeIter iter, TreeIter? position)
Moves iter
in this to the
position before position
.
- public void prepend (out TreeIter iter, TreeIter? parent)
Prepends a new row to this.
- public bool remove (ref TreeIter iter)
Removes iter
from this.
- public void reorder (TreeIter? parent, int[] new_order)
Reorders the children of parent
in
this to follow the order indicated by new_order
.
- public void set_column_types (Type[] types)
This function is meant primarily for
Objects that inherit from TreeStore, and should only be
used when constructing a new TreeStore.
- public void set_valist (TreeIter iter, va_list var_args)
See @set; this
version takes a va_list for use by language bindings.
- public void set_value (TreeIter iter, int column, Value value)
Sets the data in the cell specified by iter
and column
.
- public void set_valuesv (TreeIter iter, int[] columns, Value[] values)
A variant of
set_valist which takes the columns and values as two arrays, instead of varargs.
- public void swap (TreeIter a, TreeIter b)
Swaps a
and b
in the same level of
this.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.TreeDragDest
All known members inherited from interface Gtk.TreeDragSource
All known members inherited from interface Gtk.TreeModel
All known members inherited from interface Gtk.TreeSortable