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 108 109 110
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.TreeModelFilter</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><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="prev" 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" title="gtk.TreeModelFilter"><a name="class-gtktreemodelfilter"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.TreeModelFilter</h2><p>gtk.TreeModelFilter — a <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
which hides parts of an underlying tree (new in PyGTK 2.4)</p></div><div class="refsect1" title="Synopsis"><a name="id4024771"></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"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-modify-func" title="gtk.TreeModelFilter.set_modify_func">set_modify_func</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>types</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>column</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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 class="link" 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"><strong class="parameter"><code>child_iter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>filter_iter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>child_path</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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"><strong class="parameter"><code>filter_path</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" 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 class="link" 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" title="Ancestry"><a name="id4025119"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter">gtk.TreeModelFilter</a> (implements <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a>, <a class="link" href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a>)
</pre></div><div class="refsect1" title="gtk.TreeModelFilter Properties"><a name="properties-gtktreemodelfilter"></a><h2>gtk.TreeModelFilter 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 width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"child-model"</td><td valign="top">Read-Write-Construct Only</td><td valign="top">The <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></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" title="gtk.TreeModelFilter Signal Prototypes"><a name="signal-prototypes-gtktreemodelfilter"></a><h2>gtk.TreeModelFilter Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtktreemodel.html#signal-prototypes-gtktreemodel" title="gtk.TreeModel Signal Prototypes">gtk.TreeModel Signal Prototypes</a></p></div><div class="refsect1" title="Description"><a name="id4025287"></a><h2>Description</h2><div class="note" title="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 class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a>
is a tree model which wraps another tree model, and can do the following
things:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">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 <em class="parameter"><code>model</code></em>, <em class="parameter"><code>iter</code></em> and
<em class="parameter"><code>user_data</code></em> and returns a boolean indicating whether
the row should be filtered or not.</li><li class="listitem">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 class="listitem">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 class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a> is
created using the <a class="link" href="class-gtktreemodel.html#method-gtktreemodel--filter-new" title="gtk.TreeModel.filter_new"><code class="methodname">gtk.TreeModel.filter_new</code>()</a> method. For example:</p><pre class="programlisting">
liststore = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING)
modelfilter = liststore.filter_new()
</pre><p>The <a class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a>
objects support the Python mapping and iterator protocols. See the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
Description and the <a class="ulink" href="http://www.pygtk.org/pygtk2tutorial/sec-TreeModelInterface.html#sec-PythonProtocolSupport" target="_top">PyGTK
tutorial</a> for more information.</p></div><div class="refsect1" title="Methods"><a name="id4025428"></a><h2>Methods</h2><div class="refsect2" title="gtk.TreeModelFilter.set_visible_func"><a name="method-gtktreemodelfilter--set-visible-func"></a><h3>gtk.TreeModelFilter.set_visible_func</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_func</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>func</code></strong> :</span></p></td><td>a function called to determine the visibility
of a row</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td>User data to pass to
<code class="literal">func</code></td></tr></tbody></table><div class="note" title="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 <code class="methodname">set_visible_func</code>() method sets the
visible function used when filtering the rows of the treemodel filter to the
value of <em class="parameter"><code>func</code></em>. <em class="parameter"><code>data</code></em> is the
user data that is passed to func (see below). This method will fail if the
<a class="link" href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-column" title="gtk.TreeModelFilter.set_visible_column"><code class="methodname">set_visible_column</code>()</a>
method has already been called. The visible function signature is:</p><pre class="programlisting">
def visible_func(model, iter, user_data):
</pre><p>where <em class="parameter"><code>model</code></em> is the child <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>,
<em class="parameter"><code>iter</code></em> is a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at a row in model and <em class="parameter"><code>user_data</code></em> is the data
parameter. The function should return <code class="literal">True</code> if the row
should be visible.</p></div><div class="refsect2" title="gtk.TreeModelFilter.set_modify_func"><a name="method-gtktreemodelfilter--set-modify-func"></a><h3>gtk.TreeModelFilter.set_modify_func</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_modify_func</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>types</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>func</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>data</code></strong></span><span class="initializer">=None</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>types</code></strong> :</span></p></td><td>a sequence containing the column
types</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>func</code></strong> :</span></p></td><td>a function that is called to provide the data
for a specific row and column</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>data</code></strong> :</span></p></td><td>user data to pass to the modify function, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">set_modify_func</code>() method uses the
list of column types specified by <em class="parameter"><code>types</code></em> and the
function specified by <em class="parameter"><code>func</code></em> to provide a synthetic
model based on the child model of the <a class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a>. <em class="parameter"><code>data</code></em>
is passed to <em class="parameter"><code>func</code></em> when it is
called. <em class="parameter"><code>func</code></em> 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><pre class="programlisting">
def func(<em class="parameter"><code>model</code></em>, <em class="parameter"><code>iter</code></em>, <em class="parameter"><code>column</code></em>, <em class="parameter"><code>user_data</code></em>)
</pre><p>where <em class="parameter"><code>model</code></em> is the <a class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a>,
<em class="parameter"><code>iter</code></em> is a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at a row in <em class="parameter"><code>model</code></em>,
<em class="parameter"><code>column</code></em> is the column number to provide the value for
and <em class="parameter"><code>user_data</code></em> is
<em class="parameter"><code>data</code></em>. <em class="parameter"><code>func</code></em> should returns the
generated value for the specified location in
<em class="parameter"><code>model</code></em>.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method must be called before the <a class="link" href="class-gtktreemodelfilter.html" title="gtk.TreeModelFilter"><code class="classname">gtk.TreeModelFilter</code></a>
is associated with a <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a> and
before either of the <a class="link" href="class-gtktreemodel.html#method-gtktreemodel--get-n-columns" title="gtk.TreeModel.get_n_columns"><code class="methodname">gtk.TreeModel.get_n_columns</code>()</a>
or <a class="link" href="class-gtktreemodel.html#method-gtktreemodel--get-column-type" title="gtk.TreeModel.get_column_type"><code class="methodname">gtk.TreeModel.get_column_type</code>()</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 <em class="parameter"><code>func</code></em> is called for every access to
a value in <em class="parameter"><code>model</code></em>, it will be slow for models with a
large number of rows and/or columns.</p></div><div class="refsect2" title="gtk.TreeModelFilter.set_visible_column"><a name="method-gtktreemodelfilter--set-visible-column"></a><h3>gtk.TreeModelFilter.set_visible_column</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visible_column</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>column</code></strong> :</span></p></td><td>the number of the column containing the visible
information.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">set_visible_column</code>() method sets
the visible column setting to the value of
<em class="parameter"><code>column</code></em>. 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
<code class="literal">gobject.TYPE_BOOLEAN</code>, where <code class="literal">True</code> means
that a row is visible, and <code class="literal">False</code>, not visible. This
method will fail if the <a class="link" href="class-gtktreemodelfilter.html#method-gtktreemodelfilter--set-visible-func" title="gtk.TreeModelFilter.set_visible_func"><code class="methodname">set_visible_func</code>()</a>
method has already been called.</p></div><div class="refsect2" title="gtk.TreeModelFilter.get_model"><a name="method-gtktreemodelfilter--get-model"></a><h3>gtk.TreeModelFilter.get_model</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_model</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the child <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a></td></tr></tbody></table><div class="note" title="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 <code class="methodname">get_model</code>() method returns the
child <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a> of
the treemodel filter</p></div><div class="refsect2" title="gtk.TreeModelFilter.convert_child_iter_to_iter"><a name="method-gtktreemodelfilter--convert-child-iter-to-iter"></a><h3>gtk.TreeModelFilter.convert_child_iter_to_iter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_child_iter_to_iter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>child_iter</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>child_iter</code></strong> :</span></p></td><td>A valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to a row on the child model.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to a row in the treemodel filter.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">convert_child_iter_to_iter</code>() method
returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to the row in the treemodel filter that corresponds to the child
treemodel row pointed to by the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
specified by <em class="parameter"><code>child_iter</code></em>.</p></div><div class="refsect2" title="gtk.TreeModelFilter.convert_iter_to_child_iter"><a name="method-gtktreemodelfilter--convert-iter-to-child-iter"></a><h3>gtk.TreeModelFilter.convert_iter_to_child_iter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_iter_to_child_iter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter_iter</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filter_iter</code></strong> :</span></p></td><td>A valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to a row in the treemodel filter.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to a row in the child treemodel.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">convert_iter_to_child_iter</code>() method
a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing to the row in the child treemodel that corresponds to the treemodel
filter row pointed to by the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
specified by <em class="parameter"><code>filter_iter</code></em>.</p></div><div class="refsect2" title="gtk.TreeModelFilter.convert_child_path_to_path"><a name="method-gtktreemodelfilter--convert-child-path-to-path"></a><h3>gtk.TreeModelFilter.convert_child_path_to_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_child_path_to_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>child_path</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>child_path</code></strong> :</span></p></td><td>a tree path in the child treemodel to
convert.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a treemodel filter tree path, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">convert_child_path_to_path</code>() method
returns a treemodel filter tree path that corresponds to the child treemodel
tree path specified by <em class="parameter"><code>child_path</code></em>. If
<em class="parameter"><code>child_path</code></em> isn't a valid path on the child model,
<code class="literal">None</code> is returned.</p></div><div class="refsect2" title="gtk.TreeModelFilter.convert_path_to_child_path"><a name="method-gtktreemodelfilter--convert-path-to-child-path"></a><h3>gtk.TreeModelFilter.convert_path_to_child_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">convert_path_to_child_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter_path</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filter_path</code></strong> :</span></p></td><td>a treemodel filter tree path to
convert.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a child treemodel tree path, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="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 <code class="methodname">convert_path_to_child_path</code>() method
returns a child treemodel tree path that corresponds to the treemodel filter
tree path specified by <em class="parameter"><code>filter_path</code></em>. If
<em class="parameter"><code>filter_path</code></em> does not point to a row in the child
model, <code class="literal">None</code> is returned.</p></div><div class="refsect2" title="gtk.TreeModelFilter.refilter"><a name="method-gtktreemodelfilter--refilter"></a><h3>gtk.TreeModelFilter.refilter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">refilter</span>(<span class="methodparam"></span>)</code></pre><div class="note" title="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 <code class="methodname">refilter</code>() method emits the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
"<a class="link" 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" title="gtk.TreeModelFilter.clear_cache"><a name="method-gtktreemodelfilter--clear-cache"></a><h3>gtk.TreeModelFilter.clear_cache</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clear_cache</span>(<span class="methodparam"></span>)</code></pre><div class="note" title="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 <code class="methodname">clear_cache</code>() method clears the
treemodel filter of any cached iterators that haven't been reffed with the
<a class="link" href="class-gtktreemodel.html#method-gtktreemodel--ref-node" title="gtk.TreeModel.ref_node"><code class="methodname">gtk.TreeModel.ref_node()</code></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>
|