Libraries:Gtk:Gtk:TreeStore
Types
T
Inherits from:The T object is a list model for use with a Gtk.Gtk.TreeView.T widget. It implements the Gtk.Gtk.TreeModel.T interface, and consequentialy, can use all of the methods available there. It also implements the Gtk.Gtk.TreeSortable.T interface so it can be sorted by the view. Finally, it also implements the tree
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.
Example 29. A UI Definition fragment for a tree store
1 2 3 4 5 6 7 |
<object class="GtkTreeStore"> <columns> <column type="gchararray"/> <column type="gchararray"/> <column type="gint"/> </columns> </object> |
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
New(... @ Std.Object.T) : Gtk.Gtk.TreeStore.T
Non vararg creation function. Used primarily by language bindings.
n_columns | number of columns in the tree store |
types | an array of GType types for the columns, from first to last. [array length=n_columns] |
Returns | a new T. [transfer full] |
Newv(types @ Agg.List.T) : Gtk.Gtk.TreeStore.T
Non vararg creation function. Used primarily by language bindings.
n_columns | number of columns in the tree store |
types | an array of GType types for the columns, from first to last. [array length=n_columns] |
Returns | a new T. [transfer full] |
Methods
:Append(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T) : Std.Object.T
Appends a new row to tree_store. 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 point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or SetValue.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set to the appended row. [out] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
:Clear(self @ T) : Std.Object.T
:Insert(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T, position @ Std.Integer.SmallT) : Std.Object.T
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 larger than the number of rows at that level, then the new row will be inserted to the end of the list. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or SetValue.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set to the new row. [out] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
position | position to insert the new row |
:InsertAfter(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T, sibling @ Gtk.Gtk.TreeIter.T) : Std.Object.T
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 both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional.
iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or SetValue.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set to the new row. [out] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
sibling | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
:InsertBefore(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T, sibling @ Gtk.Gtk.TreeIter.T) : Std.Object.T
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 both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional.
iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or SetValue.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set to the new row. [out] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
sibling | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
:InsertWithValues(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T, position @ Std.Integer.SmallT, ... @ Std.Object.T) : Std.Object.T
Creates a new row at position. iter will be changed to point to this new row. If position is larger than the number of rows on the list, then the new row will be appended to the list. The row will be filled with the values given to this function.
Calling gtk_tree_store_insert_with_values (tree_store, iter, position, ...) has the same effect as calling
1 2 |
gtk_tree_store_insert (tree_store, iter, position); gtk_tree_store_set (tree_store, iter, ...); |
:InsertWithValuesv(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T, position @ Std.Integer.SmallT, columns @ Std.Object.T, values @ Gtk.GObject.Value.T, n_values @ Std.Integer.SmallT) : Std.Object.T
A variant of InsertWithValues which takes the columns and values as two arrays, instead of varargs. This function is mainly intended for language bindings.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set the new row, or NULL. [out][allow-none] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
position | position to insert the new row |
columns | an array of column numbers. [array length=n_values] |
values | an array of GValues. [array length=n_values] |
n_values | the length of the columns and values arrays |
:IsAncestor(self @ T, iter @ Gtk.Gtk.TreeIter.T, descendant @ Gtk.Gtk.TreeIter.T) : Std.Symbol.T
Returns TRUE if iter is an ancestor of descendant. That is, iter is the parent (or grandparent or great-grandparent) of descendant.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T |
descendant | A valid Gtk.Gtk.TreeIter.T |
Returns | TRUE, if iter is an ancestor of descendant |
:IterDepth(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Integer.SmallT
Returns the depth of iter. This will be 0 for anything on the root level, 1 for anything down a level, etc.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T |
Returns | The depth of iter |
:IterIsValid(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Symbol.T
WARNING: This function is slow. Only use it for debugging and/or testing purposes.
Checks if the given iter is a valid iter for this T.
tree_store | A T. |
iter | A Gtk.Gtk.TreeIter.T. |
Returns | TRUE if the iter is valid, FALSE if the iter is invalid. |
:MoveAfter(self @ T, iter @ Gtk.Gtk.TreeIter.T, position @ Gtk.Gtk.TreeIter.T) : Std.Object.T
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 moved to the start of the level.
tree_store | A T. |
iter | A Gtk.Gtk.TreeIter.T. |
position | A Gtk.Gtk.TreeIter.T. [allow-none] |
:MoveBefore(self @ T, iter @ Gtk.Gtk.TreeIter.T, position @ Gtk.Gtk.TreeIter.T) : Std.Object.T
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 moved to the end of the level.
tree_store | A T. |
iter | A Gtk.Gtk.TreeIter.T. |
position | A Gtk.Gtk.TreeIter.T or NULL. [allow-none] |
:Prepend(self @ T, iter @ Gtk.Gtk.TreeIter.T, parent @ Gtk.Gtk.TreeIter.T) : Std.Object.T
Prepends a new row to tree_store. 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 to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or SetValue.
tree_store | A T |
iter | An unset Gtk.Gtk.TreeIter.T to set to the prepended row. [out] |
parent | A valid Gtk.Gtk.TreeIter.T, or NULL. [allow-none] |
:Remove(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Symbol.T
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.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T |
Returns | TRUE if iter is still valid, FALSE if not. |
:Reorder(self @ T, parent @ Gtk.Gtk.TreeIter.T, new_order @ Std.Object.T) : Std.Object.T
Reorders the children of parent in tree_store to follow the order indicated by new_order. Note that this function only works with unsorted stores.
tree_store | A T. |
parent | A Gtk.Gtk.TreeIter.T. |
new_order | an array of integers mapping the new position of each child to its old position before the re-ordering, i.e. new_order[newpos] = oldpos. [array] |
:Set(self @ T, iter @ Gtk.Gtk.TreeIter.T, ...) : Std.Object.T
See gtk_tree_store_set(); this version takes a va_list for use by language bindings.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T for the row being modified |
var_args | va_list of column/value pairs |
:SetColumnTypes(self @ T, n_columns @ Std.Integer.SmallT, types @ Std.Object.T) : Std.Object.T
This function is meant primarily for GObjects that inherit from T, and should only be used when constructing a new T. It will not function after a row has been added, or a method on the Gtk.Gtk.TreeModel.T interface is called.
tree_store | A T |
n_columns | Number of columns for the tree store |
types | An array of GType types, one for each column. [array length=n_columns] |
:SetValist(self @ T, iter @ Gtk.Gtk.TreeIter.T, var_args @ Agg.List.T) : Std.Object.T
See gtk_tree_store_set(); this version takes a va_list for use by language bindings.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T for the row being modified |
var_args | va_list of column/value pairs |
:SetValue(self @ T, iter @ Gtk.Gtk.TreeIter.T, column @ Std.Integer.SmallT, value @ Gtk.GObject.Value.T) : Std.Object.T
Sets the data in the cell specified by iter and column. The type of value must be convertible to the type of the column.
tree_store | a T |
iter | A valid Gtk.Gtk.TreeIter.T for the row being modified |
column | column number to modify |
value | new value for the cell |
:SetValuesv(self @ T, iter @ Gtk.Gtk.TreeIter.T, columns @ Std.Object.T, values @ Gtk.GObject.Value.T, n_values @ Std.Integer.SmallT) : Std.Object.T
A variant of 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 of columns to change is not known until run-time.
tree_store | A T |
iter | A valid Gtk.Gtk.TreeIter.T for the row being modified |
columns | an array of column numbers. [array length=n_values] |
values | an array of GValues. [array length=n_values] |
n_values | the length of the columns and values arrays |
:Swap(self @ T, a @ Gtk.Gtk.TreeIter.T, b @ Gtk.Gtk.TreeIter.T) : Std.Object.T
Swaps a and b in the same level of tree_store. Note that this function only works with unsorted stores.
tree_store | A T. |
a | A Gtk.Gtk.TreeIter.T. |
b | Another Gtk.Gtk.TreeIter.T. |