1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.TreeModelFilter</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtktreemodel.html" title="gtk.TreeModel"><link rel="next" href="class-gtktreemodelsort.html" title="gtk.TreeModelSort"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.TreeModelFilter</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktreemodel.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtktreemodelsort.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtktreemodelfilter"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.TreeModelFilter</h2><p>gtk.TreeModelFilter — a <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a>
which hides parts of an underlying tree (new in PyGTK 2.4)</p></div><div class="refsect1" lang="en"><a name="id3584023"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.TreeModelFilter</span></span>(<span class="ooclass"><span class="classname"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-func" title="gtk.TreeModelFilter.set_visible_func">set_visible_func</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>func</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter-%20-set-modify-func" title="gtk.TreeModelFilter.set_modify_func">set_modify_func</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>types</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>func</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-column" title="gtk.TreeModelFilter.set_visible_column">set_visible_column</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>column</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--get-model" title="gtk.TreeModelFilter.get_model">get_model</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--convert-child-iter-to-iter" title="gtk.TreeModelFilter.convert_child_iter_to_iter">convert_child_iter_to_iter</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child_iter</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--convert-iter-to-child-iter" title="gtk.TreeModelFilter.convert_iter_to_child_iter">convert_iter_to_child_iter</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filter_iter</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--convert-child-path-to-path" title="gtk.TreeModelFilter.convert_child_path_to_path">convert_child_path_to_path</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child_path</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--convert-path-to-child-path" title="gtk.TreeModelFilter.convert_path_to_child_path">convert_path_to_child_path</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filter_path</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--refilter" title="gtk.TreeModelFilter.refilter">refilter</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--clear-cache" title="gtk.TreeModelFilter.clear_cache">clear_cache</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3584287"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter">gtk.TreeModelFilter</a> (implements <a href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a>, <a href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a>)
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3584324"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"child-model"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a> for
the filtermodel to filter. Available in GTK+ 2.4 and above.</td></tr><tr valign="top"><td valign="top">"virtual-root"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The virtual root (relative to the child model) for this
filtermodel. Available in GTK+ 2.4 and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3584421"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This object is available in PyGTK 2.4 and above.</p></div><p>A <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><tt class="classname">gtk.TreeModelFilter</tt></a>
is a tree model which wraps another tree model, and can do the following
things:</p><div class="itemizedlist"><ul type="disc"><li>Filter specific rows, based on data from a "visible
column", a column storing booleans indicating whether the row should be
filtered or not, or based on the return value of a "visible function", which
gets a <i class="parameter"><tt>model</tt></i>, <i class="parameter"><tt>iter</tt></i> and
<i class="parameter"><tt>user_data</tt></i> and returns a boolean indicating whether
the row should be filtered or not.</li><li>Modify the "appearance" of the model, using a modify
function. This is extremely powerful and allows for just changing some
values and also for creating a completely different synthetic model based on
the child model. For example, you can create a model with columns
synthesized from the data in the child model.</li><li>Set a different root node, also known as a "virtual
root". You can pass in a tree path indicating the root node for the filter
at construction time.</li></ul></div><p>A <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><tt class="classname">gtk.TreeModelFilter</tt></a> is
created using the <a href="class-gtktreemodel.html#method-gtktreemodel--filter-new" title="gtk.TreeModel.filter_new"><tt class="methodname">gtk.TreeModel.filter_new</tt>()</a> method. For example:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
liststore = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING)
modelfilter = liststore.filter_new()
</pre></td></tr></table><p></p></div><div class="refsect1" lang="en"><a name="id3584527"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--set-visible-func"></a><h3>gtk.TreeModelFilter.set_visible_func</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_func</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>func</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>func</tt></b>:</span></td><td>a function called to determine the visibility
of a row</td></tr><tr><td><span class="term"><b class="parameter"><tt>data</tt></b>:</span></td><td>User data to pass to
<tt class="literal">func</tt></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_visible_func</tt>() method sets the
visible function used when filtering the rows of the treemodel filter to the
value of <i class="parameter"><tt>func</tt></i>. <i class="parameter"><tt>data</tt></i> is the
user data that is passed to func (see below). This method will fail if the
<a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-column" title="gtk.TreeModelFilter.set_visible_column"><tt class="methodname">set_visible_column</tt>()</a>
method has already been called. The visible function signature is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
def visible_func(model, iter, user_data):
</pre></td></tr></table><p>where <i class="parameter"><tt>model</tt></i> is the child <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a>,
<i class="parameter"><tt>iter</tt></i> is a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at a row in model and <i class="parameter"><tt>user_data</tt></i> is the data
parameter. The function should return <tt class="literal">TRUE</tt> if the row
should be visible.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter- -set-modify-func"></a><h3>gtk.TreeModelFilter.set_modify_func</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_modify_func</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>types</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>func</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>data</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>types</tt></b>:</span></td><td>a sequence containing the column
types</td></tr><tr><td><span class="term"><b class="parameter"><tt>func</tt></b>:</span></td><td>a function that is called to provide the data
for a specific row and column</td></tr><tr><td><span class="term"><b class="parameter"><tt>data</tt></b>:</span></td><td>user data to pass to the modify function, or
<tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_modify_func</tt>() method uses the
list of column types specified by <i class="parameter"><tt>types</tt></i> and the
function specified by <i class="parameter"><tt>func</tt></i> to provide a synthetic
model based on the child model of the <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><tt class="classname">gtk.TreeModelFilter</tt></a>. <i class="parameter"><tt>data</tt></i>
is passed to <i class="parameter"><tt>func</tt></i> when it is
called. <i class="parameter"><tt>func</tt></i> is called for each data access to return
the data which should be displayed at the location specified using the
parameters of the modify function.</p><p>The signature of func is:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
def func(<i class="parameter"><tt>model</tt></i>, <i class="parameter"><tt>iter</tt></i>, <i class="parameter"><tt>column</tt></i>, <i class="parameter"><tt>user_data</tt></i>)
</pre></td></tr></table><p>where <i class="parameter"><tt>model</tt></i> is the <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><tt class="classname">gtk.TreeModelFilter</tt></a>,
<i class="parameter"><tt>iter</tt></i> is a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at a row in <i class="parameter"><tt>model</tt></i>,
<i class="parameter"><tt>column</tt></i> is the column number to provide the value for
and <i class="parameter"><tt>user_data</tt></i> is
<i class="parameter"><tt>data</tt></i>. <i class="parameter"><tt>func</tt></i> should returns the
generated value for the specified location in
<i class="parameter"><tt>model</tt></i>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method must be called before the <a href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><tt class="classname">gtk.TreeModelFilter</tt></a>
is associated with a <a href="class-gtktreeview.html" title="gtk.TreeView"><tt class="classname">gtk.TreeView</tt></a> and
before either of the <a href="class-gtktreemodel.html#method-gtktreemodel--get-n-columns" title="gtk.TreeModel.get_n_columns"><tt class="methodname">gtk.TreeModel.get_n_columns</tt>()</a>
or <a href="class-gtktreemodel.html#method-gtktreemodel--get-column-type" title="gtk.TreeModel.get_column_type"><tt class="methodname">gtk.TreeModel.get_column_type</tt>()</a>
methods are called. Also this method can only be called once - there is no
way to change the modify function once it is set.</p></div><p>Since <i class="parameter"><tt>func</tt></i> is called for every access to
a value in <i class="parameter"><tt>model</tt></i>, it will be slow for models with a
large number of rows and/or columns.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--set-visible-column"></a><h3>gtk.TreeModelFilter.set_visible_column</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_column</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>column</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>column</tt></b>:</span></td><td>the number of the column containing the visible
information.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">set_visible_column</tt>() method sets
the visible column setting to the value of
<i class="parameter"><tt>column</tt></i>. The visible column setting contains the
number of the "child-model" column that is used to determine the visibility
of the model rows. The specified column should be a column of type
<tt class="literal">gobject.TYPE_BOOLEAN</tt>, where <tt class="literal">True</tt> means
that a row is visible, and <tt class="literal">False</tt>, not visible. This
method will fail if the <a href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-func" title="gtk.TreeModelFilter.set_visible_func"><tt class="methodname">set_visible_func</tt>()</a>
method has already been called.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--get-model"></a><h3>gtk.TreeModelFilter.get_model</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_model</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the child <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">get_model</tt>() method returns the
child <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a> of
the treemodel filter</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--convert-child-iter-to-iter"></a><h3>gtk.TreeModelFilter.convert_child_iter_to_iter</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_child_iter_to_iter</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child_iter</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>child_iter</tt></b>:</span></td><td>A valid <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to a row on the child model.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to a row in the treemodel filter.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">convert_child_iter_to_iter</tt>() method
returns a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to the row in the treemodel filter that corresponds to the child
treemodel row pointed to by the <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
specified by <i class="parameter"><tt>child_iter</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--convert-iter-to-child-iter"></a><h3>gtk.TreeModelFilter.convert_iter_to_child_iter</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_iter_to_child_iter</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filter_iter</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filter_iter</tt></b>:</span></td><td>A valid <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to a row in the treemodel filter.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to a row in the child treemodel.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">convert_iter_to_child_iter</tt>() method
a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing to the row in the child treemodel that corresponds to the treemodel
filter row pointed to by the <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
specified by <i class="parameter"><tt>filter_iter</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--convert-child-path-to-path"></a><h3>gtk.TreeModelFilter.convert_child_path_to_path</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_child_path_to_path</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>child_path</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>child_path</tt></b>:</span></td><td>a tree path in the child treemodel to
convert.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a treemodel filter tree path, or
<tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">convert_child_path_to_path</tt>() method
returns a treemodel filter tree path that corresponds to the child treemodel
tree path specified by <i class="parameter"><tt>child_path</tt></i>. If
<i class="parameter"><tt>child_path</tt></i> isn't a valid path on the child model,
<tt class="literal">None</tt> is returned.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--convert-path-to-child-path"></a><h3>gtk.TreeModelFilter.convert_path_to_child_path</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_path_to_child_path</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>filter_path</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>filter_path</tt></b>:</span></td><td>a treemodel filter tree path to
convert.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a child treemodel tree path, or
<tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">convert_path_to_child_path</tt>() method
returns a child treemodel tree path that corresponds to the treemodel filter
tree path specified by <i class="parameter"><tt>filter_path</tt></i>. If
<i class="parameter"><tt>filter_path</tt></i> does not point to a row in the child
model, <tt class="literal">None</tt> is returned.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--refilter"></a><h3>gtk.TreeModelFilter.refilter</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">refilter</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">refilter</tt>() method emits the <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a>
"<a href="class-gtktreemodel.html#signal-gtktreemodel--row-changed" title='The "row-changed" gtk.TreeModel Signal'>row-changed</a>" signal
for each row in the child model, thereby causing the filter to re-evaluate
whether a row is visible or not.</p></div><div class="refsect2" lang="en"><a name="method-gtktreemodelfilter--clear-cache"></a><h3>gtk.TreeModelFilter.clear_cache</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clear_cache</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <tt class="methodname">clear_cache</tt>() method clears the
treemodel filter of any cached iterators that haven't been reffed with the
<a href="class-gtktreemodel.html#method-gtktreemodel--ref-node" title="gtk.TreeModel.ref_node"><tt class="methodname">gtk.TreeModel.ref_node()</tt></a>. 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. This
method should almost never be called by an application.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtktreemodel.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtktreemodelsort.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.TreeModel</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.TreeModelSort</td></tr></table></div></body></html>
|