File: class-gtkliststore.html

package info (click to toggle)
pygtk 2.12.1-6
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 25,776 kB
  • ctags: 8,213
  • sloc: xml: 168,600; python: 14,328; sh: 9,131; ansic: 2,724; makefile: 1,141
file content (154 lines) | stat: -rw-r--r-- 42,373 bytes parent folder | download
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.ListStore</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" 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-gtklinkbutton.html" title="gtk.LinkButton"><link rel="next" href="class-gtkmenu.html" title="gtk.Menu"></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.ListStore</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtklinkbutton.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkmenu.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkliststore"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.ListStore</h2><p>gtk.ListStore — a list model to use with a <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a></p></div><div class="refsect1" lang="en"><a name="id3377670"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.ListStore</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-gtkliststore.html#constructor-gtkliststore" title="Constructor">gtk.ListStore</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>column_type</code></em></span></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-gtkliststore.html#method-gtkliststore--set-column-types" title="gtk.ListStore.set_column_types">set_column_types</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</code></em></span></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-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.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-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set">set</a></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>column_num</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>value</code></em></span></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-gtkliststore.html#method-gtkliststore--remove" title="gtk.ListStore.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-gtkliststore.html#method-gtkliststore--insert" title="gtk.ListStore.insert">insert</a></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-gtkliststore.html#method-gtkliststore--insert-before" title="gtk.ListStore.insert_before">insert_before</a></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-gtkliststore.html#method-gtkliststore--insert-after" title="gtk.ListStore.insert_after">insert_after</a></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-gtkliststore.html#method-gtkliststore--prepend" title="gtk.ListStore.prepend">prepend</a></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-gtkliststore.html#method-gtkliststore--append" title="gtk.ListStore.append">append</a></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-gtkliststore.html#method-gtkliststore--clear" title="gtk.ListStore.clear">clear</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkliststore.html#method-gtkliststore--iter-is-valid" title="gtk.ListStore.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-gtkliststore.html#method-gtkliststore--reorder" title="gtk.ListStore.reorder">reorder</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>new_order</code></em></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gtkliststore.html#method-gtkliststore--swap" title="gtk.ListStore.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-gtkliststore.html#method-gtkliststore--move-after" title="gtk.ListStore.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-gtkliststore.html#method-gtkliststore--move-before" title="gtk.ListStore.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" lang="en"><a name="id3378335"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gtkliststore.html" title="gtk.ListStore">gtk.ListStore</a>
</pre></div><div class="refsect1" lang="en"><a name="id3378361"></a><h2>Implemented Interfaces</h2><p>
			<a class="link" href="class-gtkbin.html" title="gtk.Bin"><code class="classname">gtk.Bin</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">gtk.TreeModel</a>
            <a class="link" href="class-gtktreedragsource.html" title="gtk.TreeDragSource">gtk.TreeDragSource</a>
            <a class="link" href="class-gtktreedragdest.html" title="gtk.TreeDragDest">gtk.TreeDragDest</a>
            <a class="link" href="class-gtktreesortable.html" title="gtk.TreeSortable">gtk.TreeSortable</a>
		</p></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkliststore"></a><h2>gtk.ListStore Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtktreemodel.html#signal-prototypes-gtktreemodel" title="gtk.TreeModel Signal Prototypes">gtk.TreeModel Signal Prototypes</a></p><p><a class="link" href="class-gtktreesortable.html#signal-prototypes-gtktreesortable" title="gtk.TreeSortable Signal Prototypes">gtk.TreeSortable Signal Prototypes</a></p></div><div class="refsect1" lang="en"><a name="id3378449"></a><h2>Description</h2><p>The <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>
object is a list model for use with a <a class="link" href="class-gtktreeview.html" title="gtk.TreeView"><code class="classname">gtk.TreeView</code></a>
widget. It implements the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
interface, the <a class="link" href="class-gtktreesortable.html" title="gtk.TreeSortable"><code class="classname">gtk.TreeSortable</code></a> 
and the tree drag and drop interfaces.</p><p>The <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</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" lang="en"><a name="constructor-gtkliststore"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.ListStore</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>column_type</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>column_type</code></em> :</span></p></td><td>the column type of the first
column</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>optional types for succeeding
columns</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-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a></td></tr></tbody></table><p>Creates a new list store as with one or more columns with the type
specified by the arguments passed to the constructor. For example,
<code class="literal">gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING,
gtk.gdk.Pixbuf);</code> will create a new <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>
with three columns, of type int, string and <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a>
respectively. The built-in <PYGTKDOCLINK HREF="class-gobject"><code class="classname">GObject</code></PYGTKDOCLINK> types
are:</p><div class="itemizedlist"><ul type="disc"><li><code class="literal">gobject.TYPE_BOOLEAN</code></li><li><code class="literal">gobject.TYPE_BOXED</code></li><li><code class="literal">gobject.TYPE_CHAR</code></li><li><code class="literal">gobject.TYPE_DOUBLE</code></li><li><code class="literal">gobject.TYPE_ENUM</code></li><li><code class="literal">gobject.TYPE_FLAGS</code></li><li><code class="literal">gobject.TYPE_FLOAT</code></li><li><code class="literal">gobject.TYPE_INT</code></li><li><code class="literal">gobject.TYPE_INT64</code></li><li><code class="literal">gobject.TYPE_INTERFACE</code></li><li><code class="literal">gobject.TYPE_INVALID</code></li><li><code class="literal">gobject.TYPE_LONG</code></li><li><code class="literal">gobject.TYPE_NONE</code></li><li><code class="literal">gobject.TYPE_OBJECT</code></li><li><code class="literal">gobject.TYPE_PARAM</code></li><li><code class="literal">gobject.TYPE_POINTER</code></li><li><code class="literal">gobject.TYPE_PYOBJECT</code></li><li><code class="literal">gobject.TYPE_STRING</code></li><li><code class="literal">gobject.TYPE_UCHAR</code></li><li><code class="literal">gobject.TYPE_UINT</code></li><li><code class="literal">gobject.TYPE_UINT64</code></li><li><code class="literal">gobject.TYPE_ULONG</code></li></ul></div><p>The column types can be any <PYGTKDOCLINK HREF="class-gobject"><code class="classname">GObject</code></PYGTKDOCLINK> type including
those that are PyGTK objects or application defined objects that are
subclassed from the <PYGTKDOCLINK HREF="class-gobject"><code class="classname">GObject</code></PYGTKDOCLINK> class.</p></div><div class="refsect1" lang="en"><a name="id3378927"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkliststore--set-column-types"></a><h3>gtk.ListStore.set_column_types</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">set_column_types</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>type</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>type</code></em> :</span></p></td><td>the type of the first column</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>zero or more type specifications</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 <code class="methodname">set_column_types</code>() method sets the
liststore columns to the types specified by <em class="parameter"><code>type</code></em> and
any additional type parameters. This method is meant primarily for classes
that inherit from <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>,
and should only be used when constructing a new <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>.
It will not function after a row has been added, or a method on the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
interface is called.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--set-value"></a><h3>gtk.ListStore.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 valid <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>the 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>. The type of <em class="parameter"><code>value</code></em> must
be convertible to the type of the column.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--set"></a><h3>gtk.ListStore.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>column_num</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>value</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 valid <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>column_num</code></em> :</span></p></td><td>the number of the column to
modify</td></tr><tr><td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td><td>the new cell value</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional optional sets of column number -
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 should contain integer column numbers, each followed by the
value to be set (the value must be convertible to the type of the cell
column). For example, to set column 0 with type
<code class="literal">gobject.TYPE_STRING</code> to "Foo", you would write:</p><pre class="programlisting">
  liststore.set(iter, 0, "Foo")
</pre></div><div class="refsect2" lang="en"><a name="method-gtkliststore--remove"></a><h3>gtk.ListStore.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 valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> for
the row</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 still valid.</td></tr></tbody></table><p>The <code class="methodname">remove</code>() method removes the row
specified by <em class="parameter"><code>iter</code></em> from the list store and returns
True if <em class="parameter"><code>iter</code></em> is still valid.  After being removed,
<em class="parameter"><code>iter</code></em> is set to be the next valid row, or is
invalidated if it pointed to the last row.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Prior to PyGTK 2.4 this method returned a new <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a> that
is a copy of <em class="parameter"><code>iter</code></em>.</p></div></div><div class="refsect2" lang="en"><a name="method-gtkliststore--insert"></a><h3>gtk.ListStore.insert</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">insert</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>position</code></strong> :</span></p></td><td>the integer 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 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 at the new row</td></tr></tbody></table><p>The <code class="methodname">insert</code>() method creates a new row
at the location specified by <em class="parameter"><code>position</code></em>. If
<em class="parameter"><code>position</code></em> is larger than the number of rows on the
list, then the new row will be appended to the list. The row will be empty
if <em class="parameter"><code>row</code></em> is not specified or is
<code class="literal">None</code>. If <em class="parameter"><code>row</code></em> is specified it must
contain a list or tuple of ordered column values (e.g.
[<code class="literal">gobject.TYPE_STRING</code>,
<code class="literal">gobject.TYPE_INT</code>]) that are used to set the values in the
cells of the new row. Alternatively, the application can fill in row cell
values using the  <a class="link" href="class-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set"><code class="methodname">set</code>()</a> or
<a class="link" href="class-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.set_value"><code class="methodname">set_value</code>()</a> 
methods.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--insert-before"></a><h3>gtk.ListStore.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>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>sibling</code></strong> :</span></p></td><td>A valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
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 at the new row</td></tr></tbody></table><p>The <code class="methodname">insert_before</code>() method inserts a
new row before the row specified by the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
<em class="parameter"><code>sibling</code></em>. The row will be empty if
<em class="parameter"><code>row</code></em> is not specified or is <code class="literal">None</code>.
If <em class="parameter"><code>row</code></em> is specified it must contain a list or tuple
of ordered column values (e.g. [<code class="literal">gobject.TYPE_STRING</code>,
<code class="literal">gobject.TYPE_INT</code>]) that are used to set the values in the
cells of the new row. Alternatively, the application can fill in row cell
values using the <a class="link" href="class-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set"><code class="methodname">set</code>()</a> or
<a class="link" href="class-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.set_value"><code class="methodname">set_value</code>()</a>
methods.</p><p>In PyGTK 2.4, if <em class="parameter"><code>sibling</code></em> is
<code class="literal">None</code> the row will be appended to the liststore.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--insert-after"></a><h3>gtk.ListStore.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>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>sibling</code></strong> :</span></p></td><td>A valid <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
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 at the new row</td></tr></tbody></table><p>The <code class="methodname">insert_after</code>() method inserts a new
row after the row specified by the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
<em class="parameter"><code>sibling</code></em>. The row will be empty if
<em class="parameter"><code>row</code></em> is not specified or is <code class="literal">None</code>.
If <em class="parameter"><code>row</code></em> is specified it must contain a list or tuple
of ordered column values (e.g. [<code class="literal">gobject.TYPE_STRING</code>,
<code class="literal">gobject.TYPE_INT</code>]) that are used to set the values in the
cells of the new row. Alternatively, the application can fill in row cell
values using the  <a class="link" href="class-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set"><code class="methodname">set</code>()</a> or
<a class="link" href="class-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.set_value"><code class="methodname">set_value</code>()</a> 
methods.</p><p>In PyGTK 2.4, if <em class="parameter"><code>sibling</code></em> is
<code class="literal">None</code> the row will be prepended to the liststore.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--prepend"></a><h3>gtk.ListStore.prepend</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">prepend</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>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 at the new row</td></tr></tbody></table><p>The <code class="methodname">prepend</code>() method prepends a new row
to the liststore. The row will be empty if <em class="parameter"><code>row</code></em> is not
specified or is <code class="literal">None</code>. If <em class="parameter"><code>row</code></em> is
specified it must contain a list or tuple of ordered column values (e.g.
[<code class="literal">gobject.TYPE_STRING</code>,
<code class="literal">gobject.TYPE_INT</code>]) that are used to set the values in the
cells of the new row. Alternatively, the application can fill in row cell
values using the  <a class="link" href="class-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set"><code class="methodname">set</code>()</a> or
<a class="link" href="class-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.set_value"><code class="methodname">set_value</code>()</a> 
methods.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--append"></a><h3>gtk.ListStore.append</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">append</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>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 at the new row</td></tr></tbody></table><p>The <code class="methodname">append</code>() method appends a new row
to the liststore. The row will be empty if <em class="parameter"><code>row</code></em> is not
specified or is <code class="literal">None</code>. If <em class="parameter"><code>row</code></em> is
specified it must contain a list or tuple of ordered column values (e.g.
[<code class="literal">gobject.TYPE_STRING</code>,
<code class="literal">gobject.TYPE_INT</code>]) that are used to set the values in the
cells of the new row. Alternatively, the application can fill in row cell
values using the  <a class="link" href="class-gtkliststore.html#method-gtkliststore--set" title="gtk.ListStore.set"><code class="methodname">set</code>()</a> or
<a class="link" href="class-gtkliststore.html#method-gtkliststore--set-value" title="gtk.ListStore.set_value"><code class="methodname">set_value</code>()</a> 
methods.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--clear"></a><h3>gtk.ListStore.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 liststore.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--iter-is-valid"></a><h3>gtk.ListStore.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 the iter is valid,
	  <code class="literal">False</code> if the iter is invalid.</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><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>This method is slow. Only use it for debugging and/or testing
purposes.</p></div><p>The <code class="methodname">iter_is_valid</code>() method checks 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 a valid iter for this <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--reorder"></a><h3>gtk.ListStore.reorder</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">reorder</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>new_order</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>new_order</code></em> :</span></p></td><td>a list of integers mapping the new position of
	  each child to its old position before the re-ordering,
	  i.e. <em class="parameter"><code>new_order</code></em><code class="literal">[newpos] =
	  oldpos</code>.</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 <code class="methodname">reorder</code>() method reorders the <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>
items to follow the order indicated by
<em class="parameter"><code>new_order</code></em>. Note that this method only works with
unsorted stores.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--swap"></a><h3>gtk.ListStore.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" 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 liststore
rows specified by the <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>s
<em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em>. Note that this method
only works with unsorted stores.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--move-after"></a><h3>gtk.ListStore.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 <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" 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
liststore row referenced by <em class="parameter"><code>iter</code></em> to the position
after the row referenced by <em class="parameter"><code>position</code></em>. Note that this
method only works with unsorted stores. If <em class="parameter"><code>position</code></em>
is <code class="literal">None</code>, the row referenced by
<em class="parameter"><code>iter</code></em> will be moved to the start of the list.</p></div><div class="refsect2" lang="en"><a name="method-gtkliststore--move-before"></a><h3>gtk.ListStore.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" 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_before</code>() method moves the
liststore row referenced by <em class="parameter"><code>iter</code></em> to the position
before the row referenced by <em class="parameter"><code>position</code></em>. Note that this
method only works with unsorted stores. If <em class="parameter"><code>position</code></em>
is <code class="literal">None</code>, the row referenced by
<em class="parameter"><code>iter</code></em> will be moved to the end of the list.</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-gtklinkbutton.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-gtkmenu.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.LinkButton </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.Menu</td></tr></table></div></body></html>