gtk.tree_store

Module for [TreeStore] class

Types 3

The #GtkTreeStore object is a list model for use with a #GtkTreeView widget. It implements the #GtkTreeModel interface, and consequentially, can use all of the methods available there. It also implements the #GtkTreeSortable interface so it can be sorted by the view. Finally, it also implements the tree [drag and drop][gtk3-GtkTreeView-drag-and-drop] interfaces.

GtkTreeStore as GtkBuildable

The GtkTreeStore implementation of the #GtkBuildable 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>

Methods
GType _gType() @property
TreeStore self()Returns `this`, for use in `with` statements.
TreeStoreGidBuilder builder()Get builder for [gtk.tree_store.TreeStore] Returns: New builder object
gtk.tree_store.TreeStore new_(gobject.types.GType[] types)Non vararg creation function. Used primarily by language bindings.
void append(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent = null)Appends a new row to treestore. If parent is non-null, then it will append the new row after the last child of parent, otherwise it will append a row to the top level. iter will be changed to poi...
void clear()Removes all rows from tree_store
void insert(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent, int position)Creates a new row at position. If parent is non-null, then the row will be made a child of parent. Otherwise, the row will be created at the toplevel. If position is -1 or is larger than the numb...
void insertAfter(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent = null, gtk.tree_iter.TreeIter sibling = null)Inserts a new row after sibling. If sibling is null, then the row will be prepended to parent ’s children. If parent and sibling are null, then the row will be prepended to the toplevel. If bo...
void insertBefore(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent = null, gtk.tree_iter.TreeIter sibling = null)Inserts a new row before sibling. If sibling is null, then the row will be appended to parent ’s children. If parent and sibling are null, then the row will be appended to the toplevel. If bot...
void insertWithValues(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent, int position, int[] columns, gobject.value.Value[] values)A variant of [gtk.tree_store.TreeStore.insertWithValues] which takes the columns and values as two arrays, instead of varargs. This function is mainly intended for language bindings.
bool isAncestor(gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter descendant)Returns true if iter is an ancestor of descendant. That is, iter is the parent (or grandparent or great-grandparent) of descendant.
int iterDepth(gtk.tree_iter.TreeIter iter)Returns the depth of iter. This will be 0 for anything on the root level, 1 for anything down a level, etc.
bool iterIsValid(gtk.tree_iter.TreeIter iter)WARNING: This function is slow. Only use it for debugging and/or testing purposes.
void moveAfter(gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter position = null)Moves iter in tree_store to the position after position. iter and position should be in the same level. Note that this function only works with unsorted stores. If position is null, iter will be mo...
void moveBefore(gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter position = null)Moves iter in tree_store to the position before position. iter and position should be in the same level. Note that this function only works with unsorted stores. If position is null, iter will be m...
void prepend(out gtk.tree_iter.TreeIter iter, gtk.tree_iter.TreeIter parent = null)Prepends a new row to treestore. If parent is non-null, then it will prepend the new row before the first child of parent, otherwise it will prepend a row to the top level. iter will be changed t...
bool remove(gtk.tree_iter.TreeIter iter)Removes iter from tree_store. After being removed, iter is set to the next valid row at that level, or invalidated if it previously pointed to the last one.
void setColumnTypes(gobject.types.GType[] types)This function is meant primarily for #GObjects that inherit from #GtkTreeStore, and should only be used when constructing a new #GtkTreeStore. It will not function after a row has been added, or a...
void setValue(gtk.tree_iter.TreeIter iter, int column, gobject.value.Value value)Sets the data in the cell specified by iter and column. The type of value must be convertible to the type of the column.
void set(gtk.tree_iter.TreeIter iter, int[] columns, gobject.value.Value[] values)A variant of [gtk.tree_store.TreeStore.setValist] which takes the columns and values as two arrays, instead of varargs. This function is mainly intended for language bindings or in case the number...
void swap(gtk.tree_iter.TreeIter a, gtk.tree_iter.TreeIter b)Swaps `a` and `b` in the same level of tree_store. Note that this function only works with unsorted stores.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder for [gtk.tree_store.TreeStore]

Methods