GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::TreeModelSort Class Reference

A GtkTreeModelSort C++ wrapper class. More...

#include <gfc/gtk/treemodelsort.hh>

Inheritance diagram for GFC::Gtk::TreeModelSort:

GFC::G::Object GFC::Gtk::TreeModel GFC::Gtk::TreeSortable GFC::Gtk::TreeDragSource GFC::G::TypeInstance GFC::G::TypeInterface GFC::G::TypeInterface GFC::G::TypeInterface GFC::Trackable GFC::G::TypeInstance GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable GFC::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods

Protected Member Functions

Constructors

Detailed Description

A GtkTreeModelSort C++ wrapper class.

TreeModelSort implements a model that can be sorted.


Constructor & Destructor Documentation

GFC::Gtk::TreeModelSort::TreeModelSort (  GtkTreeModelSort *  tree_model,
bool  owns_reference = true
)  [explicit, protected]
 

Construct a new TreeModelSort from an existing GtkTreeModelSort.

Parameters:
tree_model A pointer to a GtkTreeModelSort.
owns_reference Set false if the initial reference count is floating, set true if it's not.

The tree_model can be a newly created GtkTreeModelSort or an existing GtkTreeModelSort (see G::Object::Object).

GFC::Gtk::TreeModelSort::TreeModelSort (  TreeModel &  child_model  ) 
 

Constructs a new tree model, with child_model as the child model.

Parameters:
child_model A TreeModel.


Member Function Documentation

void GFC::Gtk::TreeModelSort::clear_cache (   ) 
 

This method should almost never be called.

It clears the TreeModelSort of any cached iterators that haven't been reffed with 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 become invalid.

TreeIter GFC::Gtk::TreeModelSort::convert_child_iter_to_iter (  const TreeIter &  child_iter  ) 
 

Returns a TreeIter that points to the row in the TreeModelSort that corresponds to the row pointed at by child_iter.

Parameters:
child_iter A valid TreeIter pointing to a row on the child model.
Returns:
A TreeIter pointing to the row in the model being sorted.

Pointer<TreePath> GFC::Gtk::TreeModelSort::convert_child_path_to_path (  const TreePath &  child_path  ) 
 

Converts child_path to a path relative to the TreeModelSort.

Parameters:
child_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.

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.

TreeIter GFC::Gtk::TreeModelSort::convert_iter_to_child_iter (  const TreeIter &  sorted_iter  ) 
 

Returns a TreeIter that points to the row on the model being sorted that corresponds to the row on the TreeModelSort pointed to by sorted_iter.

Parameters:
sorted_iter A valid TreeIter pointing to a row on the TreeModelSort.
Returns:
A TreeIter pointing to the row on the model being sorted.

Pointer<TreePath> GFC::Gtk::TreeModelSort::convert_path_to_child_path (  const TreePath &  sorted_path  ) 
 

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

Parameters:
sorted_path A TreePath to convert.
Returns:
A newly allocated TreePath, or null.

sorted_path points to a location in the TreeModelSort. 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.

TreeModel* GFC::Gtk::TreeModelSort::get_model (   )  const
 

Returns the model the TreeModelSort is sorting.

Returns:
The "child model" being sorted.

bool GFC::Gtk::TreeModelSort::iter_is_valid (  const TreeIter &  iter  )  const
 

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

Parameters:
iter A TreeIter.
Returns:
true 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.

void GFC::Gtk::TreeModelSort::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 TreeModelSort is in 'unsorted' state.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:44 2004 for GFC-UI by doxygen 1.3.8