11.132Class GtkTreeModelSort

A GtkTreeModel which makes an underlying tree model sortable

Class GtkTreeModelSort( child_model )
child_model A GtkTreeModel

The GtkTreeModelSort is a model which implements the GtkTreeSortable interface. It does not hold any data itself, but rather is created with a child model and proxies its data. It has identical column types to this child model, and the changes in the child are propagated. The primary purpose of this model is to provide a way to sort a different model without modifying it. Note that the sort function used by GtkTreeModelSort is not guaranteed to be stable.

[...]

Methods
clear_cacheThis function should almost never be called.
convert_child_iter_to_iterReturns an iterator pointing to the row in tree_model_sort that corresponds to the row pointed at by child_iter.
convert_child_path_to_pathConverts child_path to a path relative to the tree-model-sort.
convert_iter_to_child_iterReturns an iterator pointing to the row pointed to by sorted_iter.
convert_path_to_child_pathConverts sorted_path to a path on the child model of tree_model_sort.
get_modelReturns the model the GtkTreeModelSort is sorting.
iter_is_validChecks if the given iter is a valid iter for this GtkTreeModelSort.
reset_default_sort_funcThis resets the default sort function to be in the 'unsorted' state. That is, it is in the same order as the child model. It will re-sort the model to be in the same order as the child model only if the GtkTreeModelSort is in 'unsorted' state.

Methods

clear_cache

This function should almost never be called.

GtkTreeModelSort.clear_cache()

It clears the tree_model_sort of any cached iterators that haven't been reffed with gtk_tree_model_ref_node(). This might be useful if the child model being sorted is static (and doesn't change often) and there has been a lot of unreffed access to nodes. As a side effect of this function, all unreffed iters will be invalid.

convert_child_iter_to_iter

Returns an iterator pointing to the row in tree_model_sort that corresponds to the row pointed at by child_iter.

GtkTreeModelSort.convert_child_iter_to_iter( child_iter )
child_iter A valid GtkTreeIter pointing to a row on the child model
Returna valid GtkTreeIter to a visible row in the child model, or Nil

convert_child_path_to_path

Converts child_path to a path relative to the tree-model-sort.

GtkTreeModelSort.convert_child_path_to_path( child_path )
child_path A GtkTreePath to convert
ReturnA newly allocated GtkTreePath, or NULL

That is, child_path points to a path in the child model. The returned path will point to the same row in the sorted model. If child_path isn't a valid path on the child model, then NULL is returned.

convert_iter_to_child_iter

Returns an iterator pointing to the row pointed to by sorted_iter.

GtkTreeModelSort.convert_iter_to_child_iter( sorted_iter )
sorted_iter A valid GtkTreeIter pointing to a row on tree_model_sort.
Returna GtkTreeIter

convert_path_to_child_path

Converts sorted_path to a path on the child model of tree_model_sort.

GtkTreeModelSort.convert_path_to_child_path( sorted_path )
sorted_path A GtkTreePath to convert
ReturnA GtkTreePath, or NULL

That is, sorted_path points to a location in tree_model_sort. The returned path will point to the same location in the model not being sorted. If sorted_path does not point to a location in the child model, NULL is returned.

get_model

Returns the model the GtkTreeModelSort is sorting.

GtkTreeModelSort.get_model()
Returnthe "child model" being sorted (GtkTreeModel).

iter_is_valid

Checks if the given iter is a valid iter for this GtkTreeModelSort.

GtkTreeModelSort.iter_is_valid( iter )
iter A GtkTreeIter.
ReturnTRUE if the iter is valid, FALSE if the iter is invalid.

Warning: This function is slow. Only use it for debugging and/or testing purposes.

reset_default_sort_func

This resets the default sort function to be in the 'unsorted' state. That is, it is in the same order as the child model. It will re-sort the model to be in the same order as the child model only if the GtkTreeModelSort is in 'unsorted' state.

GtkTreeModelSort.reset_default_sort_func()
Made with http://www.falconpl.org