11.130Class GtkTreeModel

The GtkTreeModel interface defines a generic tree interface for use by the GtkTreeView widget.

Class GtkTreeModel

[...]

Methods
get_column_typeReturns the type of the column.
get_flagsReturns a set of flags supported by this interface.
get_iterReturns a valid iterator pointing to path.
get_iter_firstReturns the first iterator in the tree (the one at the path "0") or Nil if the tree is empty.
get_iter_from_stringReturns a valid iterator pointing to path_string, if it exists.
get_n_columnsReturns the number of columns supported by tree_model.
get_pathReturns a newly-created GtkTreePath referenced by iter.
get_string_from_iterGenerates a string representation of the iter.
get_valueReturns value to that at column.
iter_childrenReturns an iterator pointing to the first child of parent, or Nil.
iter_has_childReturns TRUE if iter has children, FALSE otherwise.
iter_n_childrenReturns the number of children that iter has.
iter_nextReturns an iterator pointing to the node following iter at the current level, or Nil.
iter_nth_childReturns an iterator being the child of parent, using the given index.
iter_parentReturns an iterator being the parent of child, or Nil.
row_changedEmits the "row-changed" signal on tree_model.
row_deletedEmits the "row-deleted" signal on tree_model.
row_has_child_toggledEmits the "row-has-child-toggled" signal on tree_model.
row_insertedEmits the "row-inserted" signal on tree_model
rows_reorderedEmits the "rows-reordered" signal on tree_model.
signal_row_changedThis signal is emitted when a row in the model has changed.
signal_row_deletedThis signal is emitted when a row has been deleted.
signal_row_has_child_toggledThis signal is emitted when a row has gotten the first child row or lost its last child row.
signal_row_insertedThis signal is emitted when a new row has been inserted in the model.
signal_rows_reorderedThis signal is emitted when the children of a node in the GtkTreeModel have been reordered.

Methods

get_column_type

Returns the type of the column.

GtkTreeModel.get_column_type( index )
index The column index.
ReturnThe type of the column (GType).

get_flags

Returns a set of flags supported by this interface.

GtkTreeModel.get_flags()
ReturnThe 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.

get_iter

Returns a valid iterator pointing to path.

GtkTreeModel.get_iter( path )
path The GtkTreePath.
Returna GtkTreeIter
Raise
ParamError if path is invalid

get_iter_first

Returns the first iterator in the tree (the one at the path "0") or Nil if the tree is empty.

GtkTreeModel.get_iter_first()
Returna GtkTreeIter, or nil.

get_iter_from_string

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.
Returna GtkTreeIter.
Raise
ParamError if path is invalid

get_n_columns

Returns the number of columns supported by tree_model.

GtkTreeModel.get_n_columns()
ReturnThe number of columns.

get_path

Returns a newly-created GtkTreePath referenced by iter.

GtkTreeModel.get_path( iter )
iter The GtkTreeIter.
Returna newly-created GtkTreePath.

get_string_from_iter

Generates a string representation of the iter.

GtkTreeModel.get_string_from_iter( iter )
iter A GtkTreeIter.
Returna string.

This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.

get_value

Returns value to that at column.

GtkTreeModel.get_value( iter, column )
iter The GtkTreeIter.
column The column to lookup the value at.
Returnthe value

iter_children

Returns an iterator pointing to the first child of parent, or Nil.

GtkTreeModel.iter_children( parent )
parent The GtkTreeIter, or Nil.
Returna 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);

iter_has_child

Returns TRUE if iter has children, FALSE otherwise.

GtkTreeModel.iter_has_child( iter )
iter The GtkTreeIter to test for children.
ReturnTRUE if iter has children.

iter_n_children

Returns the number of children that iter has.

GtkTreeModel.iter_n_children( iter )
iter The GtkTreeIter, or NULL.
ReturnThe number of children of iter.

As a special case, if iter is NULL, then the number of toplevel nodes is returned.

iter_next

Returns an iterator pointing to the node following iter at the current level, or Nil.

GtkTreeModel.iter_next( iter )
iter The GtkTreeIter.
Returna new GtkTreeIter or Nil if there is no next row.

If there is no next iter, Nil is returned.

iter_nth_child

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.
Returna 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.

iter_parent

Returns an iterator being the parent of child, or Nil.

GtkTreeModel.iter_parent( child )
child The GtkTreeIter.
Returna 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.

row_changed

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

row_deleted

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.

row_has_child_toggled

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.

row_inserted

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

rows_reordered

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.

signal_row_changed

This signal is emitted when a row in the model has changed.

GtkTreeModel.signal_row_changed()

signal_row_deleted

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.

signal_row_has_child_toggled

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()

signal_row_inserted

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.

signal_rows_reordered

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.

Made with http://www.falconpl.org