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
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.TreeStore</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-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" lang="en"><a name="class-gtktreestore"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.TreeStore</h2><p>gtk.TreeStore — a model for tree widgets with columns</p></div><div class="refsect1" lang="en"><a name="id3592063"></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"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreedragdest.html" title="gtk.TreeDragDest">gtk.TreeDragDest</a></span></span>, <span class="ooclass"><span class="classname"><a href="class-gtktreesortable.html" title="gtk.TreeSortable">gtk.TreeSortable</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtktreestore.html#constructor-gtktreestore" title="Constructor">gtk.TreeStore</a></span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--set-value" title="gtk.TreeStore.set_value">set_value</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>column</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>value</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--set" title="gtk.TreeStore.set">set</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>...</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--remove" title="gtk.TreeStore.remove">remove</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--insert" title="gtk.TreeStore.insert">insert</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--insert-before" title="gtk.TreeStore.insert_before">insert_before</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>sibling</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--insert-after" title="gtk.TreeStore.insert_after">insert_after</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>sibling</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--prepend" title="gtk.TreeStore.prepend">prepend</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--append" title="gtk.TreeStore.append">append</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--is-ancestor" title="gtk.TreeStore.is_ancestor">is_ancestor</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>descendant</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--iter-depth" title="gtk.TreeStore.iter_depth">iter_depth</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a 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 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"><b class="parameter"><tt>iter</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--reorder" title="gtk.TreeStore.reorder">reorder</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>new_order</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--swap" title="gtk.TreeStore.swap">swap</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>a</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>b</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--move-after" title="gtk.TreeStore.move_after">move_after</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtktreestore.html#method-gtktreestore--move-before" title="gtk.TreeStore.move_before">move_before</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3592599"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtktreestore.html" title="gtk.TreeStore">gtk.TreeStore</a> (implements <a href="class-gtktreemodel.html" title="gtk.TreeModel">gtk.TreeModel</a>, <a href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a>, <a href="class-gtktreedragdest.html" title="gtk.TreeDragDest">gtk.TreeDragDest</a>, <a href="class-gtktreesortable.html" title="gtk.TreeSortable">gtk.TreeSortable</a>)
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3592648"></a><h2>Description</h2><p>A <a href="class-gtktreestore.html" title="gtk.TreeStore"><tt class="classname">gtk.TreeStore</tt></a> is
a model for multi-columned tree widgets. A <a href="class-gtktreestore.html" title="gtk.TreeStore"><tt class="classname">gtk.TreeStore</tt></a> is
a subclass of <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a> and
implements the <a href="class-gtktreemodel.html" title="gtk.TreeModel"><tt class="classname">gtk.TreeModel</tt></a>,
<a href="class-gtktreedragsource.html" title="gtk.TreeDragSource"><tt class="classname">gtk.TreeDragSource</tt></a>,
<a href="class-gtktreedragdest.html" title="gtk.TreeDragDest"><tt class="classname">gtk.TreeDragDest</tt></a>
and <a href="class-gtktreesortable.html" title="gtk.TreeSortable"><tt class="classname">gtk.TreeSortable</tt></a>
interfaces.</p></div><div class="refsect1" lang="en"><a name="constructor-gtktreestore"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.TreeStore</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>one or more column types</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtktreestore.html" title="gtk.TreeStore"><tt class="classname">gtk.TreeStore</tt></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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
gtk.TreeStore(gobject.TYPE_INT, gobject.TYPE_STRING, gtk.gdk.Pixbuf)
</pre></td></tr></table><p>will create a new <a href="class-gtktreestore.html" title="gtk.TreeStore"><tt class="classname">gtk.TreeStore</tt></a>
with three columns, of type <span class="type">int</span>, <span class="type">string</span> and <a href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><tt class="classname">gtk.gdk.Pixbuf</tt></a>
respectively.</p></div><div class="refsect1" lang="en"><a name="id3592815"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtktreestore--set-value"></a><h3>gtk.TreeStore.set_value</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_value</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>column</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>value</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a> for
the row being modified</td></tr><tr><td><span class="term"><b class="parameter"><tt>column</tt></b>:</span></td><td>the column number to
modify</td></tr><tr><td><span class="term"><b class="parameter"><tt>value</tt></b>:</span></td><td>a new value for the cell</td></tr></tbody></table><p>The <tt class="methodname">set_value</tt>() method sets the data in
the cell specified by <i class="parameter"><tt>iter</tt></i> and
<i class="parameter"><tt>column</tt></i> to the value specified by
<i class="parameter"><tt>value</tt></i>. The type of <i class="parameter"><tt>value</tt></i> must
be convertible to the type of the column.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--set"></a><h3>gtk.TreeStore.set</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>iter</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>iter</tt></i>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a> for
the row being modified</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>one or more column ID-value
pairs</td></tr></tbody></table><p>The <tt class="methodname">set</tt>() method sets the value of one
or more cells in the row referenced by <i class="parameter"><tt>iter</tt></i>. The
argument list following <i class="parameter"><tt>iter</tt></i> should contain pairs of
integer column numbers followed by the value to be set. For example, to set
column 0 with type <tt class="literal">gobject.TYPE_STRING</tt> to "Foo", you
would write:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
store.set(iter, 0, "Foo")
</pre></td></tr></table><p></p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--remove"></a><h3>gtk.TreeStore.remove</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">None</tt> in PyGTK 2.0. Returns
<tt class="literal">TRUE</tt> in PyGTK 2.2 and above if
<i class="parameter"><tt>iter</tt></i> is still valid.</td></tr></tbody></table><p>The <tt class="methodname">remove</tt>() method removes the row
pointed to by <i class="parameter"><tt>iter</tt></i> from the treestore. After being
removed, <i class="parameter"><tt>iter</tt></i> 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" lang="en"><a name="method-gtktreestore--insert"></a><h3>gtk.TreeStore.insert</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>position</tt></b>:</span></td><td>the position to insert the new
row</td></tr><tr><td><span class="term"><b class="parameter"><tt>row</tt></b>:</span></td><td>an optional list or tuple containing column
values (in order) to set on the row or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>pointing
to the new row</td></tr></tbody></table><p>The <tt class="methodname">insert</tt>() method inserts a new row
at <i class="parameter"><tt>position</tt></i>. If <i class="parameter"><tt>parent</tt></i> is not
<tt class="literal">None</tt>, then the row will be made a child of
<i class="parameter"><tt>parent</tt></i>. Otherwise, the row will be created at the
toplevel. If <i class="parameter"><tt>position</tt></i> 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 href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at the new row. If <i class="parameter"><tt>row</tt></i> is not
<tt class="literal">None</tt> 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" lang="en"><a name="method-gtktreestore--insert-before"></a><h3>gtk.TreeStore.insert_before</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_before</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>sibling</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>sibling</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>row</tt></b>:</span></td><td>an optional list or tuple containing ordered
column values to set on the row or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>pointing
to the new row</td></tr></tbody></table><p>The <tt class="methodname">insert_before</tt>() method inserts a
new row before the row pointed to by <i class="parameter"><tt>sibling</tt></i>. If
<i class="parameter"><tt>sibling</tt></i> is <tt class="literal">None</tt>, then the row will
be appended to the children of the row pointed to by
<i class="parameter"><tt>parent</tt></i>. If <i class="parameter"><tt>parent</tt></i> and
<i class="parameter"><tt>sibling</tt></i> are <tt class="literal">None</tt>, the row will be
appended to the toplevel. If both <i class="parameter"><tt>sibling</tt></i> and
<i class="parameter"><tt>parent</tt></i> are set, then <i class="parameter"><tt>parent</tt></i>
must be the parent of <i class="parameter"><tt>sibling</tt></i>. When
<i class="parameter"><tt>sibling</tt></i> is set, <i class="parameter"><tt>parent</tt></i> is
optional. This method returns a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at the new row. If <i class="parameter"><tt>row</tt></i> is not
<tt class="literal">None</tt> 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" lang="en"><a name="method-gtktreestore--insert-after"></a><h3>gtk.TreeStore.insert_after</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_after</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>sibling</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>sibling</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>row</tt></b>:</span></td><td>a tuple or list containing ordered column
values to be set in the new row</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>pointing
to the new row</td></tr></tbody></table><p>The <tt class="methodname">insert_after</tt>() method inserts a new
row after the row pointed to by <i class="parameter"><tt>sibling</tt></i>. If
<i class="parameter"><tt>sibling</tt></i> is <tt class="literal">None</tt>, then the row will
be prepended to the beginning of the children of
<i class="parameter"><tt>parent</tt></i>. If <i class="parameter"><tt>parent</tt></i> and
<i class="parameter"><tt>sibling</tt></i> are <tt class="literal">None</tt>, then the row
will be prepended to the toplevel. If both <i class="parameter"><tt>sibling</tt></i>
and <i class="parameter"><tt>parent</tt></i> are set, <i class="parameter"><tt>parent</tt></i>
must be the parent of <i class="parameter"><tt>sibling</tt></i>. When
<i class="parameter"><tt>sibling</tt></i> is set, <i class="parameter"><tt>parent</tt></i> is
optional. This method returns a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at the new row. If <i class="parameter"><tt>row</tt></i> is not
<tt class="literal">None</tt> 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" lang="en"><a name="method-gtktreestore--prepend"></a><h3>gtk.TreeStore.prepend</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">prepend</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>row</tt></b>:</span></td><td>a tuple or list containing ordered column
values to be set in the new row</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>pointing
to the new row</td></tr></tbody></table><p>The <tt class="methodname">prepend</tt>() method prepends a new row
to the treestore. If <i class="parameter"><tt>parent</tt></i> is not
<tt class="literal">None</tt>, the new row will be prepended before the first
child of <i class="parameter"><tt>parent</tt></i>, otherwise it will prepend a row to
the top level. This method returns a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at the new row. If <i class="parameter"><tt>row</tt></i> is not
<tt class="literal">None</tt> 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" lang="en"><a name="method-gtktreestore--append"></a><h3>gtk.TreeStore.append</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">append</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>row</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>, or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>row</tt></b>:</span></td><td>a tuple or list containing ordered column
values to be set in the new row</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>pointing
to the new row</td></tr></tbody></table><p>The <tt class="methodname">append</tt>() method appends a new row
to the treestore. If <i class="parameter"><tt>parent</tt></i> is not
<tt class="literal">None</tt>, the new row will be prepended after the last child
of <i class="parameter"><tt>parent</tt></i>, otherwise it will append a row to the top
level. This method returns a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
pointing at the new row. If <i class="parameter"><tt>row</tt></i> is not
<tt class="literal">None</tt> 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" lang="en"><a name="method-gtktreestore--is-ancestor"></a><h3>gtk.TreeStore.is_ancestor</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">is_ancestor</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>descendant</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a></td></tr><tr><td><span class="term"><b class="parameter"><tt>descendant</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt>, if
<i class="parameter"><tt>iter</tt></i> is an ancestor of
<i class="parameter"><tt>descendant</tt></i></td></tr></tbody></table><p>The <tt class="methodname">is_ancestor</tt>() method returns
<tt class="literal">TRUE</tt> if the row pointed to by <i class="parameter"><tt>iter</tt></i>
is an ancestor of the row pointed to by <i class="parameter"><tt>descendant</tt></i>.
That is, <i class="parameter"><tt>iter</tt></i> is the parent (or grandparent or
great-grandparent) of <i class="parameter"><tt>descendant</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--iter-depth"></a><h3>gtk.TreeStore.iter_depth</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">iter_depth</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the depth of
<i class="parameter"><tt>iter</tt></i></td></tr></tbody></table><p>The <tt class="methodname">iter_depth</tt>() method returns the
depth of the row pointed to by <i class="parameter"><tt>iter</tt></i>. This will be 0
for anything on the root level, 1 for anything down a level, etc.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--clear"></a><h3>gtk.TreeStore.clear</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">clear</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><p>The <tt class="methodname">clear</tt>() method removes all rows
from the treestore.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--iter-is-valid"></a><h3>gtk.TreeStore.iter_is_valid</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">iter_is_valid</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if
<i class="parameter"><tt>iter</tt></i> is valid for the tree
store,</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <tt class="methodname">iter_is_valid</tt>() method returns
<tt class="literal">TRUE</tt> if <i class="parameter"><tt>iter</tt></i> is a valid <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a> for
the tree store.</p><div class="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" lang="en"><a name="method-gtktreestore--reorder"></a><h3>gtk.TreeStore.reorder</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">reorder</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>parent</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>new_order</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>parent</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>new_order</tt></b>:</span></td><td>a list of integers mapping the new position of
each child to its old position before the re-ordering,
i.e. <i class="parameter"><tt>new_order</tt></i><tt class="literal">[newpos] =
oldpos</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <tt class="methodname">reorder</tt>() method reorders the
children of the tree store node pointed to by <i class="parameter"><tt>parent</tt></i>
to match the order of the list of row numbers contained in
<i class="parameter"><tt>new_order</tt></i>. Note that this method only works with
unsorted stores.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--swap"></a><h3>gtk.TreeStore.swap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">swap</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>a</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>b</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>a</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>b</tt></b>:</span></td><td>another <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <tt class="methodname">swap</tt>() method swaps the tree store
nodes pointed to by <i class="parameter"><tt>a</tt></i> and <i class="parameter"><tt>b</tt></i> in
the same level of the tree store. Note that this method only works with
unsorted stores.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--move-after"></a><h3>gtk.TreeStore.move_after</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">move_after</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>position</tt></b>:</span></td><td>a second <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
or <tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <tt class="methodname">move_after</tt>() method moves the tree
store node specified by <i class="parameter"><tt>iter</tt></i> to the position after
the node specified by
<i class="parameter"><tt>position</tt></i>. <i class="parameter"><tt>iter</tt></i> and
<i class="parameter"><tt>position</tt></i> should be in the same level. Note that this
method only works with unsorted stores. If <i class="parameter"><tt>position</tt></i>
is <tt class="literal">None</tt>, <i class="parameter"><tt>iter</tt></i> will be moved to the
start of the level.</p></div><div class="refsect2" lang="en"><a name="method-gtktreestore--move-before"></a><h3>gtk.TreeStore.move_before</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">move_before</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>iter</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>iter</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>.</td></tr><tr><td><span class="term"><b class="parameter"><tt>position</tt></b>:</span></td><td>a <a href="class-gtktreeiter.html" title="gtk.TreeIter"><tt class="classname">gtk.TreeIter</tt></a>
or <tt class="literal">None</tt>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The move_before() method moves the tree store node pointed to by
<i class="parameter"><tt>iter</tt></i> to the position before the node specified by
<i class="parameter"><tt>position</tt></i>. <i class="parameter"><tt>iter</tt></i> and
<i class="parameter"><tt>position</tt></i> should be in the same level. Note that this
method only works with unsorted stores. If <i class="parameter"><tt>position</tt></i>
is <tt class="literal">None</tt>, <i class="parameter"><tt>iter</tt></i> 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>
|