gtk.TreeModelSorta tree model that is a sorted version of a child gtk.TreeModelSynopsisgtk.TreeModelSortgobject.GObjectgtk.TreeModelgtk.TreeSortablegtk.TreeModelSortchild_modelget_modelconvert_child_path_to_pathchild_pathconvert_child_iter_to_itersort_iterchild_iterconvert_path_to_child_pathsorted_pathconvert_iter_to_child_iterchild_itersorted_iterreset_default_sort_funcclear_cacheiter_is_validiterAncestry+-- gobject.GObject
+-- gtk.TreeModelSort (implements gtk.TreeModel, gtk.TreeSortable)
gtk.TreeModelSort Properties
"model"Read-Write-ConstructThe child model for the gtk.TreeModelSort
to sort.
gtk.TreeModelSort Signal Prototypesgobject.GObject Signal Prototypesgtk.TreeSortable Signal Prototypesgtk.TreeModel Signal PrototypesDescriptionA gtk.TreeModelSort
is a sorted model of its child model. A gtk.TreeModelSort
implements the gtk.TreeModel
interface and the gtk.TreeSortable
interface to manage the sort functions.The gtk.TreeModelSort
objects support the Python mapping and iterator protocols. See the gtk.TreeModel
Description and the PyGTK
tutorial for more information.Constructorgtk.TreeModelSortchild_modelchild_model :a child gtk.TreeModelReturns :A new gtk.TreeModel.Creates a new gtk.TreeModel,
with child_model as the child model.Methodsgtk.TreeModelSort.get_modelget_modelReturns :the "child model" being
sortedThe get_model() method returns the
model that the gtk.TreeModelSort
is sorting.gtk.TreeModelSort.convert_child_path_to_pathconvert_child_path_to_pathchild_pathchild_path :A child tree path to
convertReturns :A new tree path in the treemodelsort, or
NoneThe convert_child_path_to_path() method
converts the path in the child model specified by
child_path to a path relative to the treemodelsort.
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 None is returned.gtk.TreeModelSort.convert_child_iter_to_iterconvert_child_iter_to_itersort_iterchild_itersort_iter :None or a gtk.TreeIter for
backward compatibility.child_iter :A valid gtk.TreeIter
pointing to a row on the child modelReturns :A gtk.TreeIter
pointing to the same path in the sorted model.The convert_child_iter_to_iter() method
returns a gtk.TreeIter that
points to the row in the treemodelsort that corresponds to the row pointed
to by child_iter. sort_iter
parameter should be None but can specify a gtk.TreeIter for
backward compatibility.gtk.TreeModelSort.convert_path_to_child_pathconvert_path_to_child_pathsorted_pathsorted_path :a path in the sorted modelReturns :a new path in the child model, or
NoneThe convert_path_to_child_path() method
returns a path in the child model that refers to the same row as the path in
the sorted model specified by sorted_path. That is,
sorted_path points to a location in treemodelsort and
the returned path will point to the same location in the child model. If
sorted_path does not point to a location in the child
model, None is returned.gtk.TreeModelSort.convert_iter_to_child_iterconvert_iter_to_child_iterchild_itersorted_iterchild_iter :None or a gtk.TreeIter for
backward compatibility.sorted_iter :A valid gtk.TreeIter
pointing to a row on
tree_model_sort.Returns :A gtk.TreeIter that
points to a row in the child modelThe convert_iter_to_child_iter() method
returns a gtk.TreeIter that
points to the row in the child model that is the same row pointed to by
sorted_iter in the treemodelsort.
child_iter should be None but can
specify a gtk.TreeIter for
backward compatibility.gtk.TreeModelSort.reset_default_sort_funcreset_default_sort_funcThe reset_default_sort_func() method
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 gtk.TreeModelSort
is in 'unsorted' state.gtk.TreeModelSort.clear_cacheclear_cacheThe clear_cache() method clears the
treemodelsort of any cached iterators that haven't been reffed with the
ref_node()
method. 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 gtk.TreeIter
objects will be invalid.gtk.TreeModelSort.iter_is_validiter_is_validiteriter :A gtk.TreeIter.Returns :True if
iter is validThis method is available in PyGTK 2.2 and above.The iter_is_valid() method checks if
the gtk.TreeIter
specified by iter is valid for the treemodel
sort.This method is slow. Only use it for debugging and/or testing
purposes.