1389 lines
75 KiB
HTML
1389 lines
75 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>GtkListStore: GTK+ 3 Reference Manual</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
|
||
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
|
||
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
|
||
<link rel="prev" href="GtkCellRendererSpinner.html" title="GtkCellRendererSpinner">
|
||
<link rel="next" href="GtkTreeStore.html" title="GtkTreeStore">
|
||
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
|
||
<td width="100%" align="left" class="shortcuts">
|
||
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
|
||
<a href="#GtkListStore.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
|
||
<a href="#GtkListStore.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span>
|
||
<a href="#GtkListStore.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span>
|
||
</td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
|
||
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="p" href="GtkCellRendererSpinner.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="n" href="GtkTreeStore.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
|
||
</tr></table>
|
||
<div class="refentry">
|
||
<a name="GtkListStore"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="GtkListStore.top_of_page"></a>GtkListStore</span></h2>
|
||
<p>GtkListStore — A list-like data structure that can be used with the GtkTreeView</p>
|
||
</td>
|
||
<td class="gallery_image" valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.functions"></a><h2>Functions</h2>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="functions_proto_type">
|
||
<col class="functions_proto_name">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkListStore.html" title="GtkListStore"><span class="returnvalue">GtkListStore</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-new" title="gtk_list_store_new ()">gtk_list_store_new</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<a class="link" href="GtkListStore.html" title="GtkListStore"><span class="returnvalue">GtkListStore</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-newv" title="gtk_list_store_newv ()">gtk_list_store_newv</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set-column-types" title="gtk_list_store_set_column_types ()">gtk_list_store_set_column_types</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()">gtk_list_store_set</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set-valist" title="gtk_list_store_set_valist ()">gtk_list_store_set_valist</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()">gtk_list_store_set_value</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set-valuesv" title="gtk_list_store_set_valuesv ()">gtk_list_store_set_valuesv</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gboolean</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-remove" title="gtk_list_store_remove ()">gtk_list_store_remove</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert" title="gtk_list_store_insert ()">gtk_list_store_insert</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-before" title="gtk_list_store_insert_before ()">gtk_list_store_insert_before</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-after" title="gtk_list_store_insert_after ()">gtk_list_store_insert_after</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-with-values" title="gtk_list_store_insert_with_values ()">gtk_list_store_insert_with_values</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-with-valuesv" title="gtk_list_store_insert_with_valuesv ()">gtk_list_store_insert_with_valuesv</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-prepend" title="gtk_list_store_prepend ()">gtk_list_store_prepend</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-append" title="gtk_list_store_append ()">gtk_list_store_append</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-clear" title="gtk_list_store_clear ()">gtk_list_store_clear</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">gboolean</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-iter-is-valid" title="gtk_list_store_iter_is_valid ()">gtk_list_store_iter_is_valid</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-reorder" title="gtk_list_store_reorder ()">gtk_list_store_reorder</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-swap" title="gtk_list_store_swap ()">gtk_list_store_swap</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-move-before" title="gtk_list_store_move_before ()">gtk_list_store_move_before</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">void</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-move-after" title="gtk_list_store_move_after ()">gtk_list_store_move_after</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.other"></a><h2>Types and Values</h2>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="other_proto_type">
|
||
<col class="other_proto_name">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="datatype_keyword">struct</td>
|
||
<td class="function_name"><a class="link" href="GtkListStore.html#GtkListStore-struct" title="struct GtkListStore">GtkListStore</a></td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.object-hierarchy"></a><h2>Object Hierarchy</h2>
|
||
<pre class="screen"> GObject
|
||
<span class="lineart">╰──</span> GtkListStore
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
|
||
<p>
|
||
GtkListStore implements
|
||
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a>, <a class="link" href="gtk3-GtkTreeView-drag-and-drop.html#GtkTreeDragSource">GtkTreeDragSource</a>, <a class="link" href="gtk3-GtkTreeView-drag-and-drop.html#GtkTreeDragDest">GtkTreeDragDest</a>, <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.includes"></a><h2>Includes</h2>
|
||
<pre class="synopsis">#include <gtk/gtk.h>
|
||
</pre>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.description"></a><h2>Description</h2>
|
||
<p>The <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> object is a list model for use with a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a>
|
||
widget. It implements the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> interface, and consequentialy,
|
||
can use all of the methods available there. It also implements the
|
||
<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a> interface so it can be sorted by the view.
|
||
Finally, it also implements the tree
|
||
<a class="link" href="gtk3-GtkTreeView-drag-and-drop.html" title="GtkTreeView drag-and-drop">drag and drop</a>
|
||
interfaces.</p>
|
||
<p>The <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> can accept most GObject types as a column type, though
|
||
it can’t accept all custom types. Internally, it will keep a copy of
|
||
data passed in (such as a string or a boxed pointer). Columns that
|
||
accept <span class="type">GObjects</span> are handled a little differently. The
|
||
<a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> will keep a reference to the object instead of copying the
|
||
value. As a result, if the object is modified, it is up to the
|
||
application writer to call <a class="link" href="GtkTreeModel.html#gtk-tree-model-row-changed" title="gtk_tree_model_row_changed ()"><code class="function">gtk_tree_model_row_changed()</code></a> to emit the
|
||
<a class="link" href="GtkTreeModel.html#GtkTreeModel-row-changed" title="The “row-changed” signal"><span class="type">“row_changed”</span></a> signal. This most commonly affects lists with
|
||
<span class="type">GdkPixbufs</span> stored.</p>
|
||
<p>An example for creating a simple list store:</p>
|
||
<div class="informalexample">
|
||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||
<tbody>
|
||
<tr>
|
||
<td class="listing_lines" align="right"><pre>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</pre></td>
|
||
<td class="listing_code"><pre class="programlisting"><span class="k">enum</span> <span class="p">{</span>
|
||
<span class="n">COLUMN_STRING</span><span class="p">,</span>
|
||
<span class="n">COLUMN_INT</span><span class="p">,</span>
|
||
<span class="n">COLUMN_BOOLEAN</span><span class="p">,</span>
|
||
<span class="n">N_COLUMNS</span>
|
||
<span class="p">};</span>
|
||
|
||
<span class="p">{</span>
|
||
<span class="n">GtkListStore</span> <span class="o">*</span><span class="n">list_store</span><span class="p">;</span>
|
||
<span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
|
||
<span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
|
||
<span class="n">gint</span> <span class="n">i</span><span class="p">;</span>
|
||
|
||
<span class="n">list_store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">N_COLUMNS</span><span class="p">,</span>
|
||
<span class="n">G_TYPE_STRING</span><span class="p">,</span>
|
||
<span class="n">G_TYPE_INT</span><span class="p">,</span>
|
||
<span class="n">G_TYPE_BOOLEAN</span><span class="p">);</span>
|
||
|
||
<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span>
|
||
<span class="p">{</span>
|
||
<span class="n">gchar</span> <span class="o">*</span><span class="n">some_data</span><span class="p">;</span>
|
||
|
||
<span class="n">some_data</span> <span class="o">=</span> <span class="n">get_some_data</span> <span class="p">(</span><span class="n">i</span><span class="p">);</span>
|
||
|
||
<span class="c1">// Add a new row to the model</span>
|
||
<span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">list_store</span><span class="p">,</span> <span class="o">&</span><span class="n">iter</span><span class="p">);</span>
|
||
<span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">list_store</span><span class="p">,</span> <span class="o">&</span><span class="n">iter</span><span class="p">,</span>
|
||
<span class="n">COLUMN_STRING</span><span class="p">,</span> <span class="n">some_data</span><span class="p">,</span>
|
||
<span class="n">COLUMN_INT</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span>
|
||
<span class="n">COLUMN_BOOLEAN</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span>
|
||
<span class="mi">-1</span><span class="p">);</span>
|
||
|
||
<span class="c1">// As the store will keep a copy of the string internally,</span>
|
||
<span class="c1">// we free some_data.</span>
|
||
<span class="n">g_free</span> <span class="p">(</span><span class="n">some_data</span><span class="p">);</span>
|
||
<span class="p">}</span>
|
||
|
||
<span class="c1">// Modify a particular row</span>
|
||
<span class="n">path</span> <span class="o">=</span> <span class="n">gtk_tree_path_new_from_string</span> <span class="p">(</span><span class="s">"4"</span><span class="p">);</span>
|
||
<span class="n">gtk_tree_model_get_iter</span> <span class="p">(</span><span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">list_store</span><span class="p">),</span>
|
||
<span class="o">&</span><span class="n">iter</span><span class="p">,</span>
|
||
<span class="n">path</span><span class="p">);</span>
|
||
<span class="n">gtk_tree_path_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
|
||
<span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">list_store</span><span class="p">,</span> <span class="o">&</span><span class="n">iter</span><span class="p">,</span>
|
||
<span class="n">COLUMN_BOOLEAN</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span>
|
||
<span class="mi">-1</span><span class="p">);</span>
|
||
<span class="p">}</span></pre></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<p></p>
|
||
<div class="refsect2">
|
||
<a name="id-1.3.12.27.8.7"></a><h3>Performance Considerations</h3>
|
||
<p>Internally, the <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> was implemented with a linked list with
|
||
a tail pointer prior to GTK+ 2.6. As a result, it was fast at data
|
||
insertion and deletion, and not fast at random data access. The
|
||
<a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> sets the <a class="link" href="GtkTreeModel.html#GTK-TREE-MODEL-ITERS-PERSIST:CAPS"><span class="type">GTK_TREE_MODEL_ITERS_PERSIST</span></a> flag, which means
|
||
that <a href="GtkTreeModel.html#GtkTreeIter-struct"><span class="type">GtkTreeIters</span></a> can be cached while the row exists. Thus, if
|
||
access to a particular row is needed often and your code is expected to
|
||
run on older versions of GTK+, it is worth keeping the iter around.</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="id-1.3.12.27.8.8"></a><h3>Atomic Operations</h3>
|
||
<p>It is important to note that only the methods
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-with-values" title="gtk_list_store_insert_with_values ()"><code class="function">gtk_list_store_insert_with_values()</code></a> and <a class="link" href="GtkListStore.html#gtk-list-store-insert-with-valuesv" title="gtk_list_store_insert_with_valuesv ()"><code class="function">gtk_list_store_insert_with_valuesv()</code></a>
|
||
are atomic, in the sense that the row is being appended to the store and the
|
||
values filled in in a single operation with regard to <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> signaling.
|
||
In contrast, using e.g. <a class="link" href="GtkListStore.html#gtk-list-store-append" title="gtk_list_store_append ()"><code class="function">gtk_list_store_append()</code></a> and then <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a>
|
||
will first create a row, which triggers the <a class="link" href="GtkTreeModel.html#GtkTreeModel-row-inserted" title="The “row-inserted” signal"><span class="type">“row-inserted”</span></a> signal
|
||
on <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>. The row, however, is still empty, and any signal handler
|
||
connecting to <a class="link" href="GtkTreeModel.html#GtkTreeModel-row-inserted" title="The “row-inserted” signal"><span class="type">“row-inserted”</span></a> on this particular store should be prepared
|
||
for the situation that the row might be empty. This is especially important
|
||
if you are wrapping the <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> inside a <a class="link" href="GtkTreeModelFilter.html" title="GtkTreeModelFilter"><span class="type">GtkTreeModelFilter</span></a> and are
|
||
using a <a class="link" href="GtkTreeModelFilter.html#GtkTreeModelFilterVisibleFunc" title="GtkTreeModelFilterVisibleFunc ()"><span class="type">GtkTreeModelFilterVisibleFunc</span></a>. Using any of the non-atomic operations
|
||
to append rows to the <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> will cause the
|
||
<a class="link" href="GtkTreeModelFilter.html#GtkTreeModelFilterVisibleFunc" title="GtkTreeModelFilterVisibleFunc ()"><span class="type">GtkTreeModelFilterVisibleFunc</span></a> to be visited with an empty row first; the
|
||
function must be prepared for that.</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="id-1.3.12.27.8.9"></a><h3>GtkListStore as GtkBuildable</h3>
|
||
<p>The GtkListStore implementation of the GtkBuildable interface allows
|
||
to specify the model columns with a <columns> element that may contain
|
||
multiple <column> elements, each specifying one model column. The “type”
|
||
attribute specifies the data type for the column.</p>
|
||
<p>Additionally, it is possible to specify content for the list store
|
||
in the UI definition, with the <data> element. It can contain multiple
|
||
<row> elements, each specifying to content for one row of the list model.
|
||
Inside a <row>, the <col> elements specify the content for individual cells.</p>
|
||
<p>Note that it is probably more common to define your models in the code,
|
||
and one might consider it a layering violation to specify the content of
|
||
a list store in a UI definition, data, not presentation, and common wisdom
|
||
is to separate the two, as far as possible.</p>
|
||
<p>An example of a UI Definition fragment for a list store:</p>
|
||
<div class="informalexample">
|
||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||
<tbody>
|
||
<tr>
|
||
<td class="listing_lines" align="right"><pre>1
|
||
2
|
||
3
|
||
4
|
||
5
|
||
6
|
||
7
|
||
8
|
||
9
|
||
10
|
||
11
|
||
12
|
||
13
|
||
14
|
||
15
|
||
16
|
||
17
|
||
18
|
||
19</pre></td>
|
||
<td class="listing_code"><pre class="programlisting"><span class="o"><</span><span class="n">object</span> <span class="n">class</span><span class="o">=</span><span class="s">"GtkListStore"</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">columns</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">column</span> <span class="n">type</span><span class="o">=</span><span class="s">"gchararray"</span><span class="o">/></span>
|
||
<span class="o"><</span><span class="n">column</span> <span class="n">type</span><span class="o">=</span><span class="s">"gchararray"</span><span class="o">/></span>
|
||
<span class="o"><</span><span class="n">column</span> <span class="n">type</span><span class="o">=</span><span class="s">"gint"</span><span class="o">/></span>
|
||
<span class="o"></</span><span class="n">columns</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">data</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">row</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"0"</span><span class="o">></span><span class="n">John</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"1"</span><span class="o">></span><span class="n">Doe</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"2"</span><span class="o">></span><span class="mi">25</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"></</span><span class="n">row</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">row</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"0"</span><span class="o">></span><span class="n">Johan</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"1"</span><span class="o">></span><span class="n">Dahlin</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"><</span><span class="n">col</span> <span class="n">id</span><span class="o">=</span><span class="s">"2"</span><span class="o">></span><span class="mi">50</span><span class="o"></</span><span class="n">col</span><span class="o">></span>
|
||
<span class="o"></</span><span class="n">row</span><span class="o">></span>
|
||
<span class="o"></</span><span class="n">data</span><span class="o">></span>
|
||
<span class="o"></</span><span class="n">object</span><span class="o">></span></pre></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.functions_details"></a><h2>Functions</h2>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-new"></a><h3>gtk_list_store_new ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="returnvalue">GtkListStore</span></a> *
|
||
gtk_list_store_new (<em class="parameter"><code><span class="type">gint</span> n_columns</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<p>Creates a new list store as with <em class="parameter"><code>n_columns</code></em>
|
||
columns each of the types passed
|
||
in. Note that only types derived from standard GObject fundamental types
|
||
are supported.</p>
|
||
<p>As an example, <code class="literal">gtk_list_store_new (3, G_TYPE_INT, G_TYPE_STRING,
|
||
GDK_TYPE_PIXBUF);</code> will create a new <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> with three columns, of type
|
||
int, string and <span class="type">GdkPixbuf</span> respectively.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-new.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>n_columns</p></td>
|
||
<td class="parameter_description"><p>number of columns in the list store</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p>all <span class="type">GType</span> types for the columns, from first to last</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-new.returns"></a><h4>Returns</h4>
|
||
<p> a new <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-newv"></a><h3>gtk_list_store_newv ()</h3>
|
||
<pre class="programlisting"><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="returnvalue">GtkListStore</span></a> *
|
||
gtk_list_store_newv (<em class="parameter"><code><span class="type">gint</span> n_columns</code></em>,
|
||
<em class="parameter"><code><span class="type">GType</span> *types</code></em>);</pre>
|
||
<p>Non-vararg creation function. Used primarily by language bindings.</p>
|
||
<p><span class="annotation">[<acronym title="Rename the original symbol's name to SYMBOL."><span class="acronym">rename-to</span></acronym> gtk_list_store_new]</span></p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-newv.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>n_columns</p></td>
|
||
<td class="parameter_description"><p>number of columns in the list store</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>types</p></td>
|
||
<td class="parameter_description"><p>an array of <span class="type">GType</span> types for the columns, from first to last. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_columns]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-newv.returns"></a><h4>Returns</h4>
|
||
<p>a new <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>. </p>
|
||
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-set-column-types"></a><h3>gtk_list_store_set_column_types ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_set_column_types (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> n_columns</code></em>,
|
||
<em class="parameter"><code><span class="type">GType</span> *types</code></em>);</pre>
|
||
<p>This function is meant primarily for <span class="type">GObjects</span> that inherit from <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>,
|
||
and should only be used when constructing a new <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>. It will not
|
||
function after a row has been added, or a method on the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>
|
||
interface is called.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-set-column-types.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>n_columns</p></td>
|
||
<td class="parameter_description"><p>Number of columns for the list store</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>types</p></td>
|
||
<td class="parameter_description"><p>An array length n of <span class="type">GTypes</span>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_columns]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-set"></a><h3>gtk_list_store_set ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_set (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<p>Sets the value of one or more cells in the row referenced by <em class="parameter"><code>iter</code></em>
|
||
.
|
||
The variable argument list should contain integer column numbers,
|
||
each column number followed by the value to be set.
|
||
The list is terminated by a -1. For example, to set column 0 with type
|
||
<code class="literal">G_TYPE_STRING</code> to “Foo”, you would write <code class="literal">gtk_list_store_set (store, iter,
|
||
0, "Foo", -1)</code>.</p>
|
||
<p>The value will be referenced by the store if it is a <code class="literal">G_TYPE_OBJECT</code>, and it
|
||
will be copied if it is a <code class="literal">G_TYPE_STRING</code> or <code class="literal">G_TYPE_BOXED</code>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-set.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>row iterator</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p>pairs of column number and value, terminated with -1</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-set-valist"></a><h3>gtk_list_store_set_valist ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_set_valist (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);</pre>
|
||
<p>See <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a>; this version takes a va_list for use by language
|
||
bindings.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-set-valist.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> for the row being modified</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>var_args</p></td>
|
||
<td class="parameter_description"><p>va_list of column/value pairs</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-set-value"></a><h3>gtk_list_store_set_value ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_set_value (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> column</code></em>,
|
||
<em class="parameter"><code><span class="type">GValue</span> *value</code></em>);</pre>
|
||
<p>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 class="refsect3">
|
||
<a name="gtk-list-store-set-value.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> for the row being modified</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>column</p></td>
|
||
<td class="parameter_description"><p>column number to modify</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>value</p></td>
|
||
<td class="parameter_description"><p>new value for the cell</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-set-valuesv"></a><h3>gtk_list_store_set_valuesv ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_set_valuesv (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> *columns</code></em>,
|
||
<em class="parameter"><code><span class="type">GValue</span> *values</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> n_values</code></em>);</pre>
|
||
<p>A variant of <a class="link" href="GtkListStore.html#gtk-list-store-set-valist" title="gtk_list_store_set_valist ()"><code class="function">gtk_list_store_set_valist()</code></a> which
|
||
takes the columns and values as two arrays, instead of
|
||
varargs. This function is mainly intended for
|
||
language-bindings and in case the number of columns to
|
||
change is not known until run-time.</p>
|
||
<p><span class="annotation">[<acronym title="Rename the original symbol's name to SYMBOL."><span class="acronym">rename-to</span></acronym> gtk_list_store_set]</span></p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-set-valuesv.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> for the row being modified</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>columns</p></td>
|
||
<td class="parameter_description"><p>an array of column numbers. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_values]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>values</p></td>
|
||
<td class="parameter_description"><p>an array of GValues. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_values]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>n_values</p></td>
|
||
<td class="parameter_description"><p>the length of the <em class="parameter"><code>columns</code></em>
|
||
and <em class="parameter"><code>values</code></em>
|
||
arrays</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.12</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-remove"></a><h3>gtk_list_store_remove ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||
gtk_list_store_remove (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
|
||
<p>Removes the given row from the list store. After being removed,
|
||
<em class="parameter"><code>iter</code></em>
|
||
is set to be the next valid row, or invalidated if it pointed
|
||
to the last row in <em class="parameter"><code>list_store</code></em>
|
||
.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-remove.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-remove.returns"></a><h4>Returns</h4>
|
||
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>iter</code></em>
|
||
is valid, <code class="literal">FALSE</code> if not.</p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-insert"></a><h3>gtk_list_store_insert ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_insert (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> position</code></em>);</pre>
|
||
<p>Creates a new row at <em class="parameter"><code>position</code></em>
|
||
. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to this new
|
||
row. If <em class="parameter"><code>position</code></em>
|
||
is -1 or 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 after
|
||
this function is called. To fill in values, you need to call
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a> or <a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()"><code class="function">gtk_list_store_set_value()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-insert.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>position</p></td>
|
||
<td class="parameter_description"><p>position to insert the new row, or -1 for last</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-insert-before"></a><h3>gtk_list_store_insert_before ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_insert_before (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *sibling</code></em>);</pre>
|
||
<p>Inserts a new row before <em class="parameter"><code>sibling</code></em>
|
||
. If <em class="parameter"><code>sibling</code></em>
|
||
is <code class="literal">NULL</code>, then the row will
|
||
be appended to the end of the list. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to this
|
||
new row. The row will be empty after this function is called. To fill in
|
||
values, you need to call <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a> or <a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()"><code class="function">gtk_list_store_set_value()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-insert-before.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>sibling</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-insert-after"></a><h3>gtk_list_store_insert_after ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_insert_after (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *sibling</code></em>);</pre>
|
||
<p>Inserts a new row after <em class="parameter"><code>sibling</code></em>
|
||
. If <em class="parameter"><code>sibling</code></em>
|
||
is <code class="literal">NULL</code>, then the row will be
|
||
prepended to the beginning of the list. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to
|
||
this new row. The row will be empty after this function is called. To fill
|
||
in values, you need to call <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a> or <a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()"><code class="function">gtk_list_store_set_value()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-insert-after.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>sibling</p></td>
|
||
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-insert-with-values"></a><h3>gtk_list_store_insert_with_values ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_insert_with_values (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> position</code></em>,
|
||
<em class="parameter"><code>...</code></em>);</pre>
|
||
<p>Creates a new row at <em class="parameter"><code>position</code></em>
|
||
. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to this new
|
||
row. If <em class="parameter"><code>position</code></em>
|
||
is -1, or larger than the number of rows in the list, then
|
||
the new row will be appended to the list. The row will be filled with the
|
||
values given to this function.</p>
|
||
<p>Calling
|
||
<code class="literal">gtk_list_store_insert_with_values (list_store, iter, position...)</code>
|
||
has the same effect as calling</p>
|
||
<div class="informalexample">
|
||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||
<tbody>
|
||
<tr>
|
||
<td class="listing_lines" align="right"><pre>1
|
||
2
|
||
3
|
||
4
|
||
5
|
||
6
|
||
7
|
||
8
|
||
9
|
||
10
|
||
11</pre></td>
|
||
<td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="kt">void</span>
|
||
<span class="n">insert_value</span> <span class="p">(</span><span class="n">GtkListStore</span> <span class="o">*</span><span class="n">list_store</span><span class="p">,</span>
|
||
<span class="n">GtkTreeIter</span> <span class="o">*</span><span class="n">iter</span><span class="p">,</span>
|
||
<span class="kt">int</span> <span class="n">position</span><span class="p">)</span>
|
||
<span class="p">{</span>
|
||
<span class="n">gtk_list_store_insert</span> <span class="p">(</span><span class="n">list_store</span><span class="p">,</span> <span class="n">iter</span><span class="p">,</span> <span class="n">position</span><span class="p">);</span>
|
||
<span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">list_store</span><span class="p">,</span>
|
||
<span class="n">iter</span>
|
||
<span class="c1">// ...</span>
|
||
<span class="p">);</span>
|
||
<span class="p">}</span></pre></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<p>
|
||
with the difference that the former will only emit a row_inserted signal,
|
||
while the latter will emit row_inserted, row_changed and, if the list store
|
||
is sorted, rows_reordered. Since emitting the rows_reordered signal
|
||
repeatedly can affect the performance of the program,
|
||
<a class="link" href="GtkListStore.html#gtk-list-store-insert-with-values" title="gtk_list_store_insert_with_values ()"><code class="function">gtk_list_store_insert_with_values()</code></a> should generally be preferred when
|
||
inserting rows in a sorted list store.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-insert-with-values.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row, or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>position</p></td>
|
||
<td class="parameter_description"><p>position to insert the new row, or -1 to append after existing
|
||
rows</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>...</p></td>
|
||
<td class="parameter_description"><p>pairs of column number and value, terminated with -1</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.6</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-insert-with-valuesv"></a><h3>gtk_list_store_insert_with_valuesv ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_insert_with_valuesv (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> position</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> *columns</code></em>,
|
||
<em class="parameter"><code><span class="type">GValue</span> *values</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> n_values</code></em>);</pre>
|
||
<p>A variant of <a class="link" href="GtkListStore.html#gtk-list-store-insert-with-values" title="gtk_list_store_insert_with_values ()"><code class="function">gtk_list_store_insert_with_values()</code></a> which
|
||
takes the columns and values as two arrays, instead of
|
||
varargs. This function is mainly intended for
|
||
language-bindings.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-insert-with-valuesv.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the new row, or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>position</p></td>
|
||
<td class="parameter_description"><p>position to insert the new row, or -1 for last</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>columns</p></td>
|
||
<td class="parameter_description"><p>an array of column numbers. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_values]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>values</p></td>
|
||
<td class="parameter_description"><p>an array of GValues. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_values]</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>n_values</p></td>
|
||
<td class="parameter_description"><p>the length of the <em class="parameter"><code>columns</code></em>
|
||
and <em class="parameter"><code>values</code></em>
|
||
arrays</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.6</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-prepend"></a><h3>gtk_list_store_prepend ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_prepend (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
|
||
<p>Prepends a new row to <em class="parameter"><code>list_store</code></em>
|
||
. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to this new
|
||
row. The row will be empty after this function is called. To fill in
|
||
values, you need to call <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a> or <a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()"><code class="function">gtk_list_store_set_value()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-prepend.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the prepend row. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-append"></a><h3>gtk_list_store_append ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_append (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
|
||
<p>Appends a new row to <em class="parameter"><code>list_store</code></em>
|
||
. <em class="parameter"><code>iter</code></em>
|
||
will be changed to point to this new
|
||
row. The row will be empty after this function is called. To fill in
|
||
values, you need to call <a class="link" href="GtkListStore.html#gtk-list-store-set" title="gtk_list_store_set ()"><code class="function">gtk_list_store_set()</code></a> or <a class="link" href="GtkListStore.html#gtk-list-store-set-value" title="gtk_list_store_set_value ()"><code class="function">gtk_list_store_set_value()</code></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-append.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a></p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>An unset <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to set to the appended row. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-clear"></a><h3>gtk_list_store_clear ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_clear (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>);</pre>
|
||
<p>Removes all rows from the list store.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-clear.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>a <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-iter-is-valid"></a><h3>gtk_list_store_iter_is_valid ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">gboolean</span>
|
||
gtk_list_store_iter_is_valid (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *list_store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
|
||
<div class="blockquote"><blockquote class="blockquote"><p>This function is slow. Only use it for debugging and/or testing
|
||
purposes.</p></blockquote></div>
|
||
<p>Checks if the given iter is a valid iter for this <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-iter-is-valid.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>list_store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-iter-is-valid.returns"></a><h4>Returns</h4>
|
||
<p> <code class="literal">TRUE</code> if the iter is valid, <code class="literal">FALSE</code> if the iter is invalid.</p>
|
||
</div>
|
||
<p class="since">Since: 2.2</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-reorder"></a><h3>gtk_list_store_reorder ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_reorder (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *store</code></em>,
|
||
<em class="parameter"><code><span class="type">gint</span> *new_order</code></em>);</pre>
|
||
<p>Reorders <em class="parameter"><code>store</code></em>
|
||
to follow the order indicated by <em class="parameter"><code>new_order</code></em>
|
||
. Note that
|
||
this function only works with unsorted stores.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-reorder.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>new_order</p></td>
|
||
<td class="parameter_description"><p>an array 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>. It must have
|
||
exactly as many items as the list store’s length. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.2</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-swap"></a><h3>gtk_list_store_swap ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_swap (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *a</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *b</code></em>);</pre>
|
||
<p>Swaps <em class="parameter"><code>a</code></em>
|
||
and <em class="parameter"><code>b</code></em>
|
||
in <em class="parameter"><code>store</code></em>
|
||
. Note that this function only works with
|
||
unsorted stores.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-swap.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>a</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>b</p></td>
|
||
<td class="parameter_description"><p>Another <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.2</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-move-before"></a><h3>gtk_list_store_move_before ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_move_before (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *position</code></em>);</pre>
|
||
<p>Moves <em class="parameter"><code>iter</code></em>
|
||
in <em class="parameter"><code>store</code></em>
|
||
to the position before <em class="parameter"><code>position</code></em>
|
||
. Note that this
|
||
function only works with unsorted stores. If <em class="parameter"><code>position</code></em>
|
||
is <code class="literal">NULL</code>, <em class="parameter"><code>iter</code></em>
|
||
|
||
will be moved to the end of the list.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-move-before.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>position</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.2</p>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="gtk-list-store-move-after"></a><h3>gtk_list_store_move_after ()</h3>
|
||
<pre class="programlisting"><span class="returnvalue">void</span>
|
||
gtk_list_store_move_after (<em class="parameter"><code><a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a> *store</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
|
||
<em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *position</code></em>);</pre>
|
||
<p>Moves <em class="parameter"><code>iter</code></em>
|
||
in <em class="parameter"><code>store</code></em>
|
||
to the position after <em class="parameter"><code>position</code></em>
|
||
. Note that this
|
||
function only works with unsorted stores. If <em class="parameter"><code>position</code></em>
|
||
is <code class="literal">NULL</code>, <em class="parameter"><code>iter</code></em>
|
||
|
||
will be moved to the start of the list.</p>
|
||
<div class="refsect3">
|
||
<a name="gtk-list-store-move-after.parameters"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table class="informaltable" width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>store</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>iter</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>.</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>position</p></td>
|
||
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> or <code class="literal">NULL</code>. </p></td>
|
||
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<p class="since">Since: 2.2</p>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.other_details"></a><h2>Types and Values</h2>
|
||
<div class="refsect2">
|
||
<a name="GtkListStore-struct"></a><h3>struct GtkListStore</h3>
|
||
<pre class="programlisting">struct GtkListStore;</pre>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="GtkListStore.see-also"></a><h2>See Also</h2>
|
||
<p><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, <a class="link" href="GtkTreeStore.html" title="GtkTreeStore"><span class="type">GtkTreeStore</span></a></p>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>Generated by GTK-Doc V1.33.1</div>
|
||
</body>
|
||
</html> |