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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.TreeStore</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-gtktreesortable.html" title="gtk.TreeSortable"><link rel="next" href="class-gtktreeview.html" title="gtk.TreeView"></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.TreeStore</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtktreesortable.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtktreeview.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.TreeStore"><a name="class-gtktreestore"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.TreeStore</h2><p>gtk.TreeStore — a model for tree widgets with columns</p></div><div class="refsect1" title="Synopsis"><a name="id4034980"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.TreeStore</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>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtktreedragdest.html" title="gtk.TreeDragDest">gtk.TreeDragDest</a></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtktreesortable.html" title="gtk.TreeSortable">gtk.TreeSortable</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtktreestore.html#constructor-gtktreestore" title="Constructor">gtk.TreeStore</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--set-value" title="gtk.TreeStore.set_value">set_value</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>value</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--set" title="gtk.TreeStore.set">set</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>...</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--remove" title="gtk.TreeStore.remove">remove</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-gtktreestore.html#method-gtktreestore--insert" title="gtk.TreeStore.insert">insert</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--insert-before" title="gtk.TreeStore.insert_before">insert_before</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sibling</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--insert-after" title="gtk.TreeStore.insert_after">insert_after</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sibling</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--prepend" title="gtk.TreeStore.prepend">prepend</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--append" title="gtk.TreeStore.append">append</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--is-ancestor" title="gtk.TreeStore.is_ancestor">is_ancestor</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>descendant</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--iter-depth" title="gtk.TreeStore.iter_depth">iter_depth</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-gtktreestore.html#method-gtktreestore--clear" title="gtk.TreeStore.clear">clear</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--iter-is-valid" title="gtk.TreeStore.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-gtktreestore.html#method-gtktreestore--reorder" title="gtk.TreeStore.reorder">reorder</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>new_order</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--swap" title="gtk.TreeStore.swap">swap</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>a</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>b</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--move-after" title="gtk.TreeStore.move_after">move_after</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtktreestore.html#method-gtktreestore--move-before" title="gtk.TreeStore.move_before">move_before</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id4035741"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore">gtk.TreeStore</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id4035767"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
<a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
<a class="link" href="class-gtktreedragsource.html" title="gtk.TreeDragSource"><code class="classname">gtk.TreeDragSource</code></a>
<a class="link" href="class-gtktreedragdest.html" title="gtk.TreeDragDest"><code class="classname">gtk.TreeDragDest</code></a>
<a class="link" href="class-gtktreesortable.html" title="gtk.TreeSortable"><code class="classname">gtk.TreeSortable</code></a>
</p></div><div class="refsect1" title="gtk.TreeStore Signal Prototypes"><a name="signal-prototypes-gtktreestore"></a><h2>gtk.TreeStore Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtktreesortable.html#signal-prototypes-gtktreesortable" title="gtk.TreeSortable Signal Prototypes">gtk.TreeSortable Signal Prototypes</a></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="id4035859"></a><h2>Description</h2><p>A <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a> is
a model for multi-columned tree widgets. A <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a> is
a subclass of <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK> and
implements the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>,
<a class="link" href="class-gtktreedragsource.html" title="gtk.TreeDragSource"><code class="classname">gtk.TreeDragSource</code></a>,
<a class="link" href="class-gtktreedragdest.html" title="gtk.TreeDragDest"><code class="classname">gtk.TreeDragDest</code></a>
and <a class="link" href="class-gtktreesortable.html" title="gtk.TreeSortable"><code class="classname">gtk.TreeSortable</code></a>
interfaces.</p><p>The <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</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="Constructor"><a name="constructor-gtktreestore"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.TreeStore</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>...</code></em> :</span></p></td><td>one or more column types</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a></td></tr></tbody></table><p>Creates a new tree store as with one or more columns each of the
types passed in. As an example:</p><pre class="programlisting">
gtk.TreeStore(gobject.TYPE_INT, gobject.TYPE_STRING, gtk.gdk.Pixbuf)
</pre><p>will create a new <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a>
with three columns, of type <span class="type">int</span>, <span class="type">string</span> and <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a>
respectively.</p></div><div class="refsect1" title="Methods"><a name="id4036067"></a><h2>Methods</h2><div class="refsect2" title="gtk.TreeStore.set_value"><a name="method-gtktreestore--set-value"></a><h3>gtk.TreeStore.set_value</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_value</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>value</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> for
the row being modified</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>column</code></strong> :</span></p></td><td>the column number to
modify</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>value</code></strong> :</span></p></td><td>a new value for the cell</td></tr></tbody></table><p>The <code class="methodname">set_value</code>() method sets the data in
the cell specified by <em class="parameter"><code>iter</code></em> and
<em class="parameter"><code>column</code></em> to the value specified by
<em class="parameter"><code>value</code></em>. The type of <em class="parameter"><code>value</code></em> must
be convertible to the type of the column.</p></div><div class="refsect2" title="gtk.TreeStore.set"><a name="method-gtktreestore--set"></a><h3>gtk.TreeStore.set</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></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"><em class="parameter"><code>iter</code></em> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> for
the row being modified</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>one or more column ID-value
pairs</td></tr></tbody></table><p>The <code class="methodname">set</code>() method sets the value of one
or more cells in the row referenced by <em class="parameter"><code>iter</code></em>. The
argument list following <em class="parameter"><code>iter</code></em> should contain pairs of
integer column numbers followed by the value to be set. For example, to set
column 0 with type <code class="literal">gobject.TYPE_STRING</code> to "Foo", you
would write:</p><pre class="programlisting">
store.set(iter, 0, "Foo")
</pre><p></p></div><div class="refsect2" title="gtk.TreeStore.remove"><a name="method-gtktreestore--remove"></a><h3>gtk.TreeStore.remove</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove</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">None</code> in PyGTK 2.0. Returns
<code class="literal">True</code> in PyGTK 2.2 and above if
<em class="parameter"><code>iter</code></em> is still valid.</td></tr></tbody></table><p>The <code class="methodname">remove</code>() method removes the row
pointed to by <em class="parameter"><code>iter</code></em> from the treestore. After being
removed, <em class="parameter"><code>iter</code></em> is set to the next valid row at that
level, or invalidated if it previously pointed to the last one.</p></div><div class="refsect2" title="gtk.TreeStore.insert"><a name="method-gtktreestore--insert"></a><h3>gtk.TreeStore.insert</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</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>parent</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>position</code></strong> :</span></p></td><td>the position to insert the new
row</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>row</code></strong> :</span></p></td><td>an optional list or tuple containing column
values (in order) to set on the row or
<code class="literal">None</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>
pointing to the new row</td></tr></tbody></table><p>The <code class="methodname">insert</code>() method inserts a new row
at <em class="parameter"><code>position</code></em>. If <em class="parameter"><code>parent</code></em> is not
<code class="literal">None</code>, then the row will be made a child of
<em class="parameter"><code>parent</code></em>. Otherwise, the row will be created at the
toplevel. If <em class="parameter"><code>position</code></em> is larger than the number of
rows at that level, then the new row will be inserted to the end of the
list. This method returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the new row. If <em class="parameter"><code>row</code></em> is not
<code class="literal">None</code> it must be a tuple or list containing ordered column
values that are used to set values in the columns of the row.</p></div><div class="refsect2" title="gtk.TreeStore.insert_before"><a name="method-gtktreestore--insert-before"></a><h3>gtk.TreeStore.insert_before</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_before</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sibling</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</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>parent</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>sibling</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>row</code></strong> :</span></p></td><td>an optional list or tuple containing ordered
column values to set on the row or
<code class="literal">None</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>
pointing to the new row</td></tr></tbody></table><p>The <code class="methodname">insert_before</code>() method inserts a
new row before the row pointed to by <em class="parameter"><code>sibling</code></em>. If
<em class="parameter"><code>sibling</code></em> is <code class="literal">None</code>, then the row will
be appended to the children of the row pointed to by
<em class="parameter"><code>parent</code></em>. If <em class="parameter"><code>parent</code></em> and
<em class="parameter"><code>sibling</code></em> are <code class="literal">None</code>, the row will be
appended to the toplevel. If both <em class="parameter"><code>sibling</code></em> and
<em class="parameter"><code>parent</code></em> are set, then <em class="parameter"><code>parent</code></em>
must be the parent of <em class="parameter"><code>sibling</code></em>. When
<em class="parameter"><code>sibling</code></em> is set, <em class="parameter"><code>parent</code></em> is
optional. This method returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the new row. If <em class="parameter"><code>row</code></em> is not
<code class="literal">None</code> it must be a tuple or list containing ordered column
values that are used to set values in the columns of the row.</p></div><div class="refsect2" title="gtk.TreeStore.insert_after"><a name="method-gtktreestore--insert-after"></a><h3>gtk.TreeStore.insert_after</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_after</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>sibling</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</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>parent</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>sibling</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>row</code></strong> :</span></p></td><td>a tuple or list containing ordered column
values to be set in the new row</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 the new row</td></tr></tbody></table><p>The <code class="methodname">insert_after</code>() method inserts a new
row after the row pointed to by <em class="parameter"><code>sibling</code></em>. If
<em class="parameter"><code>sibling</code></em> is <code class="literal">None</code>, then the row will
be prepended to the beginning of the children of
<em class="parameter"><code>parent</code></em>. If <em class="parameter"><code>parent</code></em> and
<em class="parameter"><code>sibling</code></em> are <code class="literal">None</code>, then the row
will be prepended to the toplevel. If both <em class="parameter"><code>sibling</code></em>
and <em class="parameter"><code>parent</code></em> are set, <em class="parameter"><code>parent</code></em>
must be the parent of <em class="parameter"><code>sibling</code></em>. When
<em class="parameter"><code>sibling</code></em> is set, <em class="parameter"><code>parent</code></em> is
optional. This method returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the new row. If <em class="parameter"><code>row</code></em> is not
<code class="literal">None</code> it must be a tuple or list containing ordered column
values that are used to set values in the columns of the row.</p></div><div class="refsect2" title="gtk.TreeStore.prepend"><a name="method-gtktreestore--prepend"></a><h3>gtk.TreeStore.prepend</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">prepend</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</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>parent</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>row</code></strong> :</span></p></td><td>a tuple or list containing ordered column
values to be set in the new row</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 the new row</td></tr></tbody></table><p>The <code class="methodname">prepend</code>() method prepends a new row
to the treestore. If <em class="parameter"><code>parent</code></em> is not
<code class="literal">None</code>, the new row will be prepended before the first
child of <em class="parameter"><code>parent</code></em>, otherwise it will prepend a row to
the top level. This method returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the new row. If <em class="parameter"><code>row</code></em> is not
<code class="literal">None</code> it must be a tuple or list containing ordered column
values that are used to set values in the columns of the row.</p></div><div class="refsect2" title="gtk.TreeStore.append"><a name="method-gtktreestore--append"></a><h3>gtk.TreeStore.append</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">append</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>row</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>parent</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>, or
<code class="literal">None</code></td></tr><tr><td><p><span class="term"><strong class="parameter"><code>row</code></strong> :</span></p></td><td>a tuple or list containing ordered column
values to be set in the new row</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 the new row</td></tr></tbody></table><p>The <code class="methodname">append</code>() method appends a new row
to the treestore. If <em class="parameter"><code>parent</code></em> is not
<code class="literal">None</code>, the new row will be prepended after the last child
of <em class="parameter"><code>parent</code></em>, otherwise it will append a row to the top
level. This method returns a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the new row. If <em class="parameter"><code>row</code></em> is not
<code class="literal">None</code> it must be a tuple or list containing ordered column
values that are used to set values in the columns of the row.</p></div><div class="refsect2" title="gtk.TreeStore.is_ancestor"><a name="method-gtktreestore--is-ancestor"></a><h3>gtk.TreeStore.is_ancestor</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">is_ancestor</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>descendant</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"><strong class="parameter"><code>descendant</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 an ancestor of
<em class="parameter"><code>descendant</code></em></td></tr></tbody></table><p>The <code class="methodname">is_ancestor</code>() method returns
<code class="literal">True</code> if the row pointed to by <em class="parameter"><code>iter</code></em>
is an ancestor of the row pointed to by <em class="parameter"><code>descendant</code></em>.
That is, <em class="parameter"><code>iter</code></em> is the parent (or grandparent or
great-grandparent) of <em class="parameter"><code>descendant</code></em>.</p></div><div class="refsect2" title="gtk.TreeStore.iter_depth"><a name="method-gtktreestore--iter-depth"></a><h3>gtk.TreeStore.iter_depth</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">iter_depth</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>the depth of
<em class="parameter"><code>iter</code></em></td></tr></tbody></table><p>The <code class="methodname">iter_depth</code>() method returns the
depth of the row pointed to by <em class="parameter"><code>iter</code></em>. This will be 0
for anything on the root level, 1 for anything down a level, etc.</p></div><div class="refsect2" title="gtk.TreeStore.clear"><a name="method-gtktreestore--clear"></a><h3>gtk.TreeStore.clear</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clear</span>(<span class="methodparam"></span>)</code></pre><p>The <code class="methodname">clear</code>() method removes all rows
from the treestore.</p></div><div class="refsect2" title="gtk.TreeStore.iter_is_valid"><a name="method-gtktreestore--iter-is-valid"></a><h3>gtk.TreeStore.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
store,</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.2 and above.</p></div><p>The <code class="methodname">iter_is_valid</code>() method returns
<code class="literal">True</code> if <em class="parameter"><code>iter</code></em> is a valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> for
the tree store.</p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This function is slow. Only use it for debugging and/or
testing purposes.</p></div></div><div class="refsect2" title="gtk.TreeStore.reorder"><a name="method-gtktreestore--reorder"></a><h3>gtk.TreeStore.reorder</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">reorder</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>parent</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>new_order</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>parent</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"><strong class="parameter"><code>new_order</code></strong> :</span></p></td><td>a list of integers. The child nodes will be
rearranged so that the <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a>
node that is at position index
<em class="parameter"><code>new_order</code></em><code class="literal">[i]</code> will be
located at position index
<code class="literal">i</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.2 and above.</p></div><p>The <code class="methodname">reorder</code>() method reorders the
children of the tree store node pointed to by
<em class="parameter"><code>parent</code></em> to match the order of the list of row
numbers contained in <em class="parameter"><code>new_order</code></em>. The child nodes
will be rearranged so that the <a class="link" href="class-gtktreestore.html" title="gtk.TreeStore"><code class="classname">gtk.TreeStore</code></a>
node that is at position index
<em class="parameter"><code>new_order</code></em><code class="literal">[i]</code> will be located
at position index <code class="literal">i</code>. Note that this method only
works with unsorted stores.</p></div><div class="refsect2" title="gtk.TreeStore.swap"><a name="method-gtktreestore--swap"></a><h3>gtk.TreeStore.swap</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">swap</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>a</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>b</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>a</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"><strong class="parameter"><code>b</code></strong> :</span></p></td><td>another <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</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.2 and above.</p></div><p>The <code class="methodname">swap</code>() method swaps the tree store
nodes pointed to by <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> in
the same level of the tree store. Note that this method only works with
unsorted stores.</p></div><div class="refsect2" title="gtk.TreeStore.move_after"><a name="method-gtktreestore--move-after"></a><h3>gtk.TreeStore.move_after</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">move_after</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</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"><strong class="parameter"><code>position</code></strong> :</span></p></td><td>a second <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
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.2 and above.</p></div><p>The <code class="methodname">move_after</code>() method moves the tree
store node specified by <em class="parameter"><code>iter</code></em> to the position after
the node specified by
<em class="parameter"><code>position</code></em>. <em class="parameter"><code>iter</code></em> and
<em class="parameter"><code>position</code></em> should be in the same level. Note that this
method only works with unsorted stores. If <em class="parameter"><code>position</code></em>
is <code class="literal">None</code>, <em class="parameter"><code>iter</code></em> will be moved to the
start of the level.</p></div><div class="refsect2" title="gtk.TreeStore.move_before"><a name="method-gtktreestore--move-before"></a><h3>gtk.TreeStore.move_before</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">move_before</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>iter</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>position</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"><strong class="parameter"><code>position</code></strong> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
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.2 and above.</p></div><p>The move_before() method moves the tree store node pointed to by
<em class="parameter"><code>iter</code></em> to the position before the node specified by
<em class="parameter"><code>position</code></em>. <em class="parameter"><code>iter</code></em> and
<em class="parameter"><code>position</code></em> should be in the same level. Note that this
method only works with unsorted stores. If <em class="parameter"><code>position</code></em>
is <code class="literal">None</code>, <em class="parameter"><code>iter</code></em> will be moved to the
end of the level.</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-gtktreesortable.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-gtktreeview.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.TreeSortable </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.TreeView</td></tr></table></div></body></html>
|