The GtkTreeModel interface defines a generic tree interface for use by the GtkTreeView widget.
Class GtkTreeModel
[...]
Methods | |
get_column_type | Returns the type of the column. |
get_flags | Returns a set of flags supported by this interface. |
get_iter | Returns a valid iterator pointing to path. |
get_iter_first | Returns the first iterator in the tree (the one at the path "0") or Nil if the tree is empty. |
get_iter_from_string | Returns a valid iterator pointing to path_string, if it exists. |
get_n_columns | Returns the number of columns supported by tree_model. |
get_path | Returns a newly-created GtkTreePath referenced by iter. |
get_string_from_iter | Generates a string representation of the iter. |
get_value | Returns value to that at column. |
iter_children | Returns an iterator pointing to the first child of parent, or Nil. |
iter_has_child | Returns TRUE if iter has children, FALSE otherwise. |
iter_n_children | Returns the number of children that iter has. |
iter_next | Returns an iterator pointing to the node following iter at the current level, or Nil. |
iter_nth_child | Returns an iterator being the child of parent, using the given index. |
iter_parent | Returns an iterator being the parent of child, or Nil. |
row_changed | Emits the "row-changed" signal on tree_model. |
row_deleted | Emits the "row-deleted" signal on tree_model. |
row_has_child_toggled | Emits the "row-has-child-toggled" signal on tree_model. |
row_inserted | Emits the "row-inserted" signal on tree_model |
rows_reordered | Emits the "rows-reordered" signal on tree_model. |
signal_row_changed | This signal is emitted when a row in the model has changed. |
signal_row_deleted | This signal is emitted when a row has been deleted. |
signal_row_has_child_toggled | This signal is emitted when a row has gotten the first child row or lost its last child row. |
signal_row_inserted | This signal is emitted when a new row has been inserted in the model. |
signal_rows_reordered | This signal is emitted when the children of a node in the GtkTreeModel have been reordered. |
Returns the type of the column.
GtkTreeModel.get_column_type( index )
index | The column index. |
Return | The type of the column (GType). |
Returns a set of flags supported by this interface.
GtkTreeModel.get_flags()
Return | The flags supported by this interface. |
The flags are a bitwise combination of GtkTreeModelFlags. The flags supported should not change during the lifecycle of the tree_model.
Returns a valid iterator pointing to path.
GtkTreeModel.get_iter( path )
path | The GtkTreePath. | ||
Return | a GtkTreeIter | ||
Raise |
|
Returns the first iterator in the tree (the one at the path "0") or Nil if the tree is empty.
GtkTreeModel.get_iter_first()
Return | a GtkTreeIter, or nil. |
Returns a valid iterator pointing to path_string, if it exists.
GtkTreeModel.get_iter_from_string( path_string )
path_string | A string representation of a GtkTreePath. | ||
Return | a GtkTreeIter. | ||
Raise |
|
Returns the number of columns supported by tree_model.
GtkTreeModel.get_n_columns()
Return | The number of columns. |
Returns a newly-created GtkTreePath referenced by iter.
GtkTreeModel.get_path( iter )
iter | The GtkTreeIter. |
Return | a newly-created GtkTreePath. |
Generates a string representation of the iter.
GtkTreeModel.get_string_from_iter( iter )
iter | A GtkTreeIter. |
Return | a string. |
This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
Returns value to that at column.
GtkTreeModel.get_value( iter, column )
iter | The GtkTreeIter. |
column | The column to lookup the value at. |
Return | the value |
Returns an iterator pointing to the first child of parent, or Nil.
GtkTreeModel.iter_children( parent )
parent | The GtkTreeIter, or Nil. |
Return | a new GtkTreeIter, or Nil if there is no children. |
If parent is NULL returns the first node, equivalent to gtk_tree_model_get_iter_first (iter);
Returns TRUE if iter has children, FALSE otherwise.
GtkTreeModel.iter_has_child( iter )
iter | The GtkTreeIter to test for children. |
Return | TRUE if iter has children. |
Returns the number of children that iter has.
GtkTreeModel.iter_n_children( iter )
iter | The GtkTreeIter, or NULL. |
Return | The number of children of iter. |
As a special case, if iter is NULL, then the number of toplevel nodes is returned.
Returns an iterator pointing to the node following iter at the current level, or Nil.
GtkTreeModel.iter_next( iter )
iter | The GtkTreeIter. |
Return | a new GtkTreeIter or Nil if there is no next row. |
If there is no next iter, Nil is returned.
Returns an iterator being the child of parent, using the given index.
GtkTreeModel.iter_nth_child( parent, n )
parent | The GtkTreeIter to get the child from, or NULL. |
n | Then index of the desired child. |
Return | a new GtkTreeIter, or Nil if the nth child is not found. |
The first index is 0. If n is too big, or parent has no children, Nil is returned. As a special case, if parent is NULL, then the nth root node is set.
Returns an iterator being the parent of child, or Nil.
GtkTreeModel.iter_parent( child )
child | The GtkTreeIter. |
Return | a new GtkTreeIter, or Nil if child has not parent. |
If child is at the toplevel, and doesn't have a parent, then Nil is returned.
Emits the "row-changed" signal on tree_model.
GtkTreeModel.row_changed( path, iter )
path | A GtkTreePath pointing to the changed row |
iter | A valid GtkTreeIter pointing to the changed row |
Emits the "row-deleted" signal on tree_model.
GtkTreeModel.row_deleted( path )
path | A GtkTreePath pointing to the previous location of the deleted row. |
This should be called by models after a row has been removed. The location pointed to by path should be the location that the row previously was at. It may not be a valid location anymore.
Emits the "row-has-child-toggled" signal on tree_model.
GtkTreeModel.row_has_child_toggled( path, A )
path | A GtkTreePath pointing to the changed row |
A | valid GtkTreeIter pointing to the changed row |
This should be called by models after the child state of a node changes.
Emits the "row-inserted" signal on tree_model
GtkTreeModel.row_inserted( path, iter )
path | A GtkTreePath pointing to the inserted row |
iter | A valid GtkTreeIter pointing to the inserted row |
Emits the "rows-reordered" signal on tree_model.
GtkTreeModel.rows_reordered( path, iter, new_order )
path | A GtkTreePath pointing to the tree node whose children have been reordered |
iter | A valid GtkTreeIter pointing to the node whose children have been reordered, or NULL if the depth of path is 0. |
new_order | an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. new_order[newpos] = oldpos. |
This should be called by models when their rows have been reordered.
This signal is emitted when a row in the model has changed.
GtkTreeModel.signal_row_changed()
This signal is emitted when a row has been deleted.
GtkTreeModel.signal_row_deleted()
Note that no iterator is passed to the signal handler, since the row is already deleted.
Implementations of GtkTreeModel must emit row-deleted before removing the node from its internal data structures. This is because models and views which access and monitor this model might have references on the node which need to be released in the row-deleted handler.
This signal is emitted when a row has gotten the first child row or lost its last child row.
GtkTreeModel.signal_row_has_child_toggled()
This signal is emitted when a new row has been inserted in the model.
GtkTreeModel.signal_row_inserted()
Note that the row may still be empty at this point, since it is a common pattern to first insert an empty row, and then fill it with the desired values.
This signal is emitted when the children of a node in the GtkTreeModel have been reordered.
GtkTreeModel.signal_rows_reordered()
Note that this signal is not emitted when rows are reordered by DND, since this is implemented by removing and then reinserting the row.