/usr/share/gtk-doc/html/pygtk/class-pygtkgenerictreemodel.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.GenericTreeModel</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-pygtkgenericcellrenderer.html" title="gtk.GenericCellRenderer"><link rel="next" href="class-gtkhandlebox.html" title="gtk.HandleBox"></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.GenericTreeModel</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pygtkgenericcellrenderer.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkhandlebox.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.GenericTreeModel"><a name="class-pygtkgenerictreemodel"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.GenericTreeModel</h2><p>gtk.GenericTreeModel — a TreeView model that helps create tree models in
Python</p></div><div class="refsect1" title="Synopsis"><a name="id3724227"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.GenericTreeModel</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>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-pygtkgenerictreemodel.html#constructor-gtkgenerictreemodel" title="Constructor">gtk.GenericTreeModel</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--invalidate-iters" title="gtk.GenericTreeModel.invalidate_iters">invalidate_iters</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--iter-is-valid" title="gtk.GenericTreeModel.iter_is_valid">iter_is_valid</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--get-user-data" title="gtk.GenericTreeModel.get_user_data">get_user_data</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--create-tree-iter" title="gtk.GenericTreeModel.create_tree_iter">create_tree_iter</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3724389"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel">gtk.GenericTreeModel</a> (implements <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a>)
</pre></div><div class="refsect1" title="Properties"><a name="id3724422"></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 width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"leak-references"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, creating a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> will
bump the reference count of the object used as the internal row
reference. This may cause a memory leak but will prevent problems with
objects being destroyed while still in use in a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>. Set
this to <code class="literal">False</code> only if the model saves the objects used in
tree iters.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="id3724522"></a><h2>Description</h2><p>The <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
helps in the creation of <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a> tree
models in Python. The <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
is subclassed to provide a new tree model that provides the tree model
behavior using methods with predefined names that are called by the <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
methods as required to provide the various tree model operations. The
methods that need to be defined by the programmer in Python are:</p><code class="methodsynopsis"> def <span class="methodname">on_get_flags</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_get_n_columns</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_get_column_type</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>index</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_get_iter</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>path</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_get_path</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>rowref</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_get_value</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>rowref</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>column</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_next</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>rowref</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_children</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>parent</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_has_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>rowref</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_n_children</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>rowref</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_nth_child</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>parent</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>n</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname">on_iter_parent</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>self</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>child</code></em></span></span>)</code><p>See the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
description for details of the above methods.</p><p>In PyGTK 2.4 and above the <a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--invalidate-iters" title="gtk.GenericTreeModel.invalidate_iters"><code class="methodname">invalidate_iters</code>()</a>
and <a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--iter-is-valid" title="gtk.GenericTreeModel.iter_is_valid"><code class="methodname">iter_is_valid</code>()</a>
methods are available to help manage the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects and their Python object references. These are particularly useful
when the "leak-references" property is set to
<code class="literal">False</code>.</p><p>The tree models derived from <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
are protected from problems with out of date <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects because <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects are automatically checked for validity with the tree model.</p><p>If a custom tree model doesn't support persistent iters
(i.e. <code class="literal">gtk.TREE_MODEL_ITERS_PERSIST</code> is not set in the
return from the <a class="link" href="class-gtktreemodel.html#method-gtktreemodel--get-flags" title="gtk.TreeModel.get_flags"><code class="methodname">gtk.TreeModel.get_flags</code>()</a>
method), it can call the <a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--invalidate-iters" title="gtk.GenericTreeModel.invalidate_iters"><code class="methodname">invalidate_iters</code>()</a>
method to invalidate all its outstanding <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects when it changes the model (e.g. after inserting a new row). The tree
model can also dispose of any Python objects that it passed references to
<a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects after calling the <a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--invalidate-iters" title="gtk.GenericTreeModel.invalidate_iters"><code class="methodname">invalidate_iters</code>()</a>
method.</p><p>Applications can use the <a class="link" href="class-pygtkgenerictreemodel.html#method-gtkgenerictreemodel--iter-is-valid" title="gtk.GenericTreeModel.iter_is_valid"><code class="methodname">iter_is_valid</code>()</a>
method to determine if a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> is
still valid for the custom tree model.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkgenerictreemodel"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.GenericTreeModel</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>a new <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
object</td></tr></tbody></table><p>Creates a new <a class="link" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><code class="classname">gtk.GenericTreeModel</code></a>
object</p></div><div class="refsect1" title="Methods"><a name="id3725192"></a><h2>Methods</h2><div class="refsect2" title="gtk.GenericTreeModel.invalidate_iters"><a name="method-gtkgenerictreemodel--invalidate-iters"></a><h3>gtk.GenericTreeModel.invalidate_iters</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">invalidate_iters</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">invalidate_iters</code>() method
invalidates all the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
objects for the custom tree model.</p></div><div class="refsect2" title="gtk.GenericTreeModel.iter_is_valid"><a name="method-gtkgenerictreemodel--iter-is-valid"></a><h3>gtk.GenericTreeModel.iter_is_valid</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">iter_is_valid</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>iter</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if
<em class="parameter"><code>iter</code></em> is valid for the tree model;
otherwise, <code class="literal">False</code> is
returned.</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">iter_is_valid</code>() method returns
<code class="literal">True</code> if the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
specified by <em class="parameter"><code>iter</code></em> is valid for the custom tree
model.</p></div><div class="refsect2" title="gtk.GenericTreeModel.get_user_data"><a name="method-gtkgenerictreemodel--get-user-data"></a><h3>gtk.GenericTreeModel.get_user_data</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_user_data</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>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>iter</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
created by this tree model.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>Python object reference that is wrapped by this
<code class="classname">gtk.TreeIter</code>.</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method should be treated as protected. It should only
be used by derived classes.</p></div><p><code class="classname">gtk.GenericTreeModel</code> transparently wraps arbitrary Python objects to instances of <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>. E.g. you return anything from <code class="methodname">on_get_iter</code> and the model wraps the value, so <code class="methodname">get_iter</code> method returns a <code class="classname">gtk.TreeIter</code>. This method allows to retrieve the Python object used to construct given iterator.</p></div><div class="refsect2" title="gtk.GenericTreeModel.create_tree_iter"><a name="method-gtkgenerictreemodel--create-tree-iter"></a><h3>gtk.GenericTreeModel.create_tree_iter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">create_tree_iter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>user_data</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>user_data</code></strong> :</span></p></td><td>a Python object, the same you would return from
e.g. <code class="methodname">on_get_iter</code>.</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>.</td></tr></tbody></table><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method should be treated as protected. It should only
be used by derived classes.</p></div><p><code class="classname">gtk.GenericTreeModel</code> transparently wraps arbitrary Python objects to instances of <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>. E.g. you return anything from <code class="methodname">on_get_iter</code> and the model wraps the value, so <code class="methodname">get_iter</code> method returns a <code class="classname">gtk.TreeIter</code>. This method allows you to perform this wrapping explicitly, not just from a predefined set of methods.</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-pygtkgenericcellrenderer.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-gtkhandlebox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.GenericCellRenderer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.HandleBox</td></tr></table></div></body></html>
|