gtk.TreeModelFilter.TreeModelFilter Class Reference

Inheritance diagram for gtk.TreeModelFilter.TreeModelFilter:

gobject.ObjectG.ObjectG List of all members.

Public Member Functions

GtkTreeModelFiltergetTreeModelFilterStruct ()
 this (GtkTreeModelFilter *gtkTreeModelFilter)
 Sets our main struct and passes it to the parent class.
void setVisibleFunc (GtkTreeModelFilterVisibleFunc func, void *data, GtkDestroyNotify destroy)
 Sets the visible function used when filtering the filter to be func.
void setModifyFunc (int nColumns, GType *types, GtkTreeModelFilterModifyFunc func, void *data, GtkDestroyNotify destroy)
 With the n_columns and types parameters, you give an array of column types for this model (which will be exposed to the parent model/view).
void setVisibleColumn (int column)
 Sets column of the child_model to be the column where filter should look for visibility information.
TreeModel getModel ()
 Returns a pointer to the child model of filter.
int convertChildIterToIter (TreeIter filterIter, TreeIter childIter)
 Sets filter_iter to point to the row in filter that corresponds to the row pointed at by child_iter.
void convertIterToChildIter (TreeIter childIter, TreeIter filterIter)
 Sets child_iter to point to the row pointed to by filter_iter.
TreePath convertChildPathToPath (TreePath childPath)
 Converts child_path to a path relative to filter.
TreePath convertPathToChildPath (TreePath filterPath)
 Converts filter_path to a path on the child model of filter.
void refilter ()
 Emits row_changed for each row in the child model, which causes the filter to re-evaluate whether a row is visible or not.
void clearCache ()
 This function should almost never be called.

Static Public Member Functions

static TreeModel newTreeModelFilter (TreeModel childModel, TreePath root)
 Creates a new GtkTreeModel, with child_model as the child_model and root as the virtual root.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GtkTreeModelFiltergtkTreeModelFilter
 the main Gtk struct

Constructor & Destructor Documentation

gtk.TreeModelFilter.TreeModelFilter.this ( GtkTreeModelFilter gtkTreeModelFilter  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

void gtk.TreeModelFilter.TreeModelFilter.clearCache (  ) 

This function should almost never be called.

It clears the filter of any cached iterators that haven't been reffed with gtk_tree_model_ref_node(). This might be useful if the child model being filtered 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. filter: A GtkTreeModelFilter. Since 2.4 Property Details The "child-model" property "child-model" GtkTreeModel : Read / Write / Construct Only The model for the filtermodel to filter.

int gtk.TreeModelFilter.TreeModelFilter.convertChildIterToIter ( TreeIter  filterIter,
TreeIter  childIter 
)

Sets filter_iter to point to the row in filter that corresponds to the row pointed at by child_iter.

If filter_iter was not set, FALSE is returned. filter: A GtkTreeModelFilter. filter_iter: An uninitialized GtkTreeIter. child_iter: A valid GtkTreeIter pointing to a row on the child model. Returns: TRUE, if filter_iter was set, i.e. if child_iter is a valid iterator pointing to a visible row in child model. Since 2.4

TreePath gtk.TreeModelFilter.TreeModelFilter.convertChildPathToPath ( TreePath  childPath  ) 

Converts child_path to a path relative to filter.

That is, child_path points to a path in the child model. The rerturned path will point to the same row in the filtered model. If child_path isn't a valid path on the child model or points to a row which is not visible in filter, then NULL is returned. filter: A GtkTreeModelFilter. child_path: A GtkTreePath to convert. Returns: A newly allocated GtkTreePath, or NULL. Since 2.4

void gtk.TreeModelFilter.TreeModelFilter.convertIterToChildIter ( TreeIter  childIter,
TreeIter  filterIter 
)

Sets child_iter to point to the row pointed to by filter_iter.

filter: A GtkTreeModelFilter. child_iter: An uninitialized GtkTreeIter. filter_iter: A valid GtkTreeIter pointing to a row on filter. Since 2.4

TreePath gtk.TreeModelFilter.TreeModelFilter.convertPathToChildPath ( TreePath  filterPath  ) 

Converts filter_path to a path on the child model of filter.

That is, filter_path points to a location in filter. The returned path will point to the same location in the model not being filtered. If filter_path does not point to a location in the child model, NULL is returned. filter: A GtkTreeModelFilter. filter_path: A GtkTreePath to convert. Returns: A newly allocated GtkTreePath, or NULL. Since 2.4

TreeModel gtk.TreeModelFilter.TreeModelFilter.getModel (  ) 

Returns a pointer to the child model of filter.

filter: A GtkTreeModelFilter. Returns: A pointer to a GtkTreeModel. Since 2.4

void* gtk.TreeModelFilter.TreeModelFilter.getStruct (  )  [protected]

the main Gtk struct as a void*

Reimplemented from gobject.ObjectG.ObjectG.

GtkTreeModelFilter* gtk.TreeModelFilter.TreeModelFilter.getTreeModelFilterStruct (  ) 

static TreeModel gtk.TreeModelFilter.TreeModelFilter.newTreeModelFilter ( TreeModel  childModel,
TreePath  root 
) [static]

Creates a new GtkTreeModel, with child_model as the child_model and root as the virtual root.

child_model: A GtkTreeModel. root: A GtkTreePath or NULL. Returns: A new GtkTreeModel. Since 2.4

void gtk.TreeModelFilter.TreeModelFilter.refilter (  ) 

Emits row_changed for each row in the child model, which causes the filter to re-evaluate whether a row is visible or not.

filter: A GtkTreeModelFilter. Since 2.4

void gtk.TreeModelFilter.TreeModelFilter.setModifyFunc ( int  nColumns,
GType types,
GtkTreeModelFilterModifyFunc  func,
void *  data,
GtkDestroyNotify  destroy 
)

With the n_columns and types parameters, you give an array of column types for this model (which will be exposed to the parent model/view).

The func, data and destroy parameters are for specifying the modify function. The modify function will get called for each data access, the goal of the modify function is to return the data which should be displayed at the location specified using the parameters of the modify function. filter: A GtkTreeModelFilter. n_columns: The number of columns in the filter model. types: The GTypes of the columns. func: A GtkTreeModelFilterModifyFunc data: User data to pass to the modify function, or NULL. destroy: Destroy notifier of data, or NULL. Since 2.4

void gtk.TreeModelFilter.TreeModelFilter.setVisibleColumn ( int  column  ) 

Sets column of the child_model to be the column where filter should look for visibility information.

columns should be a column of type G_TYPE_BOOLEAN, where TRUE means that a row is visible, and FALSE if not. filter: A GtkTreeModelFilter. column: A gint which is the column containing the visible information. Since 2.4

void gtk.TreeModelFilter.TreeModelFilter.setVisibleFunc ( GtkTreeModelFilterVisibleFunc  func,
void *  data,
GtkDestroyNotify  destroy 
)

Sets the visible function used when filtering the filter to be func.

The function should return TRUE if the given row should be visible and FALSE otherwise. If the condition calculated by the function changes over time (e.g. because it depends on some global parameters), you must call gtk_tree_model_filter_refilter() to keep the visibility information of the model uptodate. filter: A GtkTreeModelFilter. func: A GtkTreeModelFilterVisibleFunc, the visible function. data: User data to pass to the visible function, or NULL. destroy: Destroy notifier of data, or NULL. Since 2.4


Member Data Documentation

GtkTreeModelFilter* gtk.TreeModelFilter.TreeModelFilter.gtkTreeModelFilter [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo