<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkListStore">
<refmeta>
<refentrytitle role="top_of_page" id="GtkListStore.top_of_page">GtkListStore</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkListStore</refname>
<refpurpose>A list-like data structure that can be used with the GtkTreeView</refpurpose>
</refnamediv>

<refsect1 id="GtkListStore.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkListStore"><returnvalue>GtkListStore</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-list-store-new">gtk_list_store_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkListStore"><returnvalue>GtkListStore</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-list-store-newv">gtk_list_store_newv</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-set-column-types">gtk_list_store_set_column_types</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-set">gtk_list_store_set</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-set-valist">gtk_list_store_set_valist</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-set-value">gtk_list_store_set_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-set-valuesv">gtk_list_store_set_valuesv</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-remove">gtk_list_store_remove</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-insert">gtk_list_store_insert</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-insert-before">gtk_list_store_insert_before</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-insert-after">gtk_list_store_insert_after</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-insert-with-values">gtk_list_store_insert_with_values</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-insert-with-valuesv">gtk_list_store_insert_with_valuesv</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-prepend">gtk_list_store_prepend</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-append">gtk_list_store_append</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-clear">gtk_list_store_clear</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-iter-is-valid">gtk_list_store_iter_is_valid</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-reorder">gtk_list_store_reorder</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-swap">gtk_list_store_swap</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-move-before">gtk_list_store_move_before</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-list-store-move-after">gtk_list_store_move_after</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkListStore.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkListStore-struct">GtkListStore</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkListStore.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkListStore
</screen>
</refsect1>
<refsect1 id="GtkListStore.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkListStore implements
 <link linkend="GtkTreeModel">GtkTreeModel</link>,  <link linkend="GtkTreeDragSource">GtkTreeDragSource</link>,  <link linkend="GtkTreeDragDest">GtkTreeDragDest</link>,  <link linkend="GtkTreeSortable">GtkTreeSortable</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>

</refsect1>

<refsect1 id="GtkListStore.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkListStore.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GtkListStore"><type>GtkListStore</type></link> object is a list model for use with a <link linkend="GtkTreeView"><type>GtkTreeView</type></link>
widget.  It implements the <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> interface, and consequentialy,
can use all of the methods available there.  It also implements the
<link linkend="GtkTreeSortable"><type>GtkTreeSortable</type></link> interface so it can be sorted by the view.
Finally, it also implements the tree
<link linkend="gtk3-GtkTreeView-drag-and-drop">drag and drop</link>
interfaces.</para>
<para>The <link linkend="GtkListStore"><type>GtkListStore</type></link> 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 <link linkend="GObjects"><type>GObjects</type></link> are handled a little differently.  The
<link linkend="GtkListStore"><type>GtkListStore</type></link> 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 <link linkend="gtk-tree-model-row-changed"><function>gtk_tree_model_row_changed()</function></link> to emit the
<link linkend="GtkTreeModel-row-changed"><type>“row_changed”</type></link> signal.  This most commonly affects lists with
<link linkend="GdkTextures"><type>GdkTextures</type></link> stored.</para>
<para>An example for creating a simple list store:</para>
<informalexample><programlisting role="example"><![CDATA[
enum {
  COLUMN_STRING,
  COLUMN_INT,
  COLUMN_BOOLEAN,
  N_COLUMNS
};

{
  GtkListStore *list_store;
  GtkTreePath *path;
  GtkTreeIter iter;
  gint i;

  list_store = gtk_list_store_new (N_COLUMNS,
                                   G_TYPE_STRING,
                                   G_TYPE_INT,
                                   G_TYPE_BOOLEAN);

  for (i = 0; i < 10; i++)
    {
      gchar *some_data;

      some_data = get_some_data (i);

      // Add a new row to the model
      gtk_list_store_append (list_store, &iter);
      gtk_list_store_set (list_store, &iter,
                          COLUMN_STRING, some_data,
                          COLUMN_INT, i,
                          COLUMN_BOOLEAN,  FALSE,
                          -1);

      // As the store will keep a copy of the string internally,
      // we free some_data.
      g_free (some_data);
    }

  // Modify a particular row
  path = gtk_tree_path_new_from_string ("4");
  gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store),
                           &iter,
                           path);
  gtk_tree_path_free (path);
  gtk_list_store_set (list_store, &iter,
                      COLUMN_BOOLEAN, TRUE,
                      -1);
}
]]></programlisting></informalexample>
<para></para>
<refsect2><title>Performance Considerations</title><para>Internally, the <link linkend="GtkListStore"><type>GtkListStore</type></link> 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
<link linkend="GtkListStore"><type>GtkListStore</type></link> sets the <link linkend="GTK-TREE-MODEL-ITERS-PERSIST:CAPS"><type>GTK_TREE_MODEL_ITERS_PERSIST</type></link> flag, which means
that <link linkend="GtkTreeIters"><type>GtkTreeIters</type></link> 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.</para>
</refsect2>
<refsect2><title>Atomic Operations</title><para>It is important to note that only the methods
<link linkend="gtk-list-store-insert-with-values"><function>gtk_list_store_insert_with_values()</function></link> and <link linkend="gtk-list-store-insert-with-valuesv"><function>gtk_list_store_insert_with_valuesv()</function></link>
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 <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> signaling.
In contrast, using e.g. <link linkend="gtk-list-store-append"><function>gtk_list_store_append()</function></link> and then <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link>
will first create a row, which triggers the <link linkend="GtkTreeModel-row-inserted"><type>“row-inserted”</type></link> signal
on <link linkend="GtkListStore"><type>GtkListStore</type></link>. The row, however, is still empty, and any signal handler
connecting to <link linkend="GtkTreeModel-row-inserted"><type>“row-inserted”</type></link> 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 <link linkend="GtkListStore"><type>GtkListStore</type></link> inside a <link linkend="GtkTreeModelFilter"><type>GtkTreeModelFilter</type></link> and are
using a <link linkend="GtkTreeModelFilterVisibleFunc"><type>GtkTreeModelFilterVisibleFunc</type></link>. Using any of the non-atomic operations
to append rows to the <link linkend="GtkListStore"><type>GtkListStore</type></link> will cause the
<link linkend="GtkTreeModelFilterVisibleFunc"><type>GtkTreeModelFilterVisibleFunc</type></link> to be visited with an empty row first; the
function must be prepared for that.</para>
</refsect2>
<refsect2><title>GtkListStore as GtkBuildable</title><para>The GtkListStore implementation of the GtkBuildable interface allows
to specify the model columns with a &lt;columns> element that may contain
multiple &lt;column> elements, each specifying one model column. The “type”
attribute specifies the data type for the column.</para>
<para>Additionally, it is possible to specify content for the list store
in the UI definition, with the &lt;data> element. It can contain multiple
&lt;row> elements, each specifying to content for one row of the list model.
Inside a &lt;row>, the &lt;col> elements specify the content for individual cells.</para>
<para>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.</para>
<para>An example of a UI Definition fragment for a list store:</para>
<informalexample><programlisting role="example"><![CDATA[
<object class="GtkListStore">
  <columns>
    <column type="gchararray"/>
    <column type="gchararray"/>
    <column type="gint"/>
  </columns>
  <data>
    <row>
      <col id="0">John</col>
      <col id="1">Doe</col>
      <col id="2">25</col>
    </row>
    <row>
      <col id="0">Johan</col>
      <col id="1">Dahlin</col>
      <col id="2">50</col>
    </row>
  </data>
</object>
]]></programlisting></informalexample>
<para></para>
</refsect2>

</refsect1>
<refsect1 id="GtkListStore.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-list-store-new" role="function">
<title>gtk_list_store_new&#160;()</title>
<indexterm zone="gtk-list-store-new"><primary>gtk_list_store_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkListStore"><returnvalue>GtkListStore</returnvalue></link>&#160;*
gtk_list_store_new (<parameter><link linkend="gint"><type>gint</type></link> n_columns</parameter>,
                    <parameter>...</parameter>);</programlisting>
<para>Creates a new list store as with <parameter>n_columns</parameter>
 columns each of the types passed
in.  Note that only types derived from standard GObject fundamental types
are supported.</para>
<para>As an example, <literal>gtk_list_store_new (3, G_TYPE_INT, G_TYPE_STRING,
GDK_TYPE_TEXTURE);</literal> will create a new <link linkend="GtkListStore"><type>GtkListStore</type></link> with three columns, of type
int, string and <link linkend="GdkTexture"><type>GdkTexture</type></link>, respectively.</para>
<refsect3 id="gtk-list-store-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>n_columns</para></entry>
<entry role="parameter_description"><para>number of columns in the list store</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>all <link linkend="GType"><type>GType</type></link> types for the columns, from first to last</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-list-store-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkListStore"><type>GtkListStore</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-newv" role="function">
<title>gtk_list_store_newv&#160;()</title>
<indexterm zone="gtk-list-store-newv"><primary>gtk_list_store_newv</primary></indexterm>
<programlisting language="C"><link linkend="GtkListStore"><returnvalue>GtkListStore</returnvalue></link>&#160;*
gtk_list_store_newv (<parameter><link linkend="gint"><type>gint</type></link> n_columns</parameter>,
                     <parameter><link linkend="GType"><type>GType</type></link> *types</parameter>);</programlisting>
<para>Non-vararg creation function.  Used primarily by language bindings.</para>

<para><emphasis role="annotation">[<acronym>rename-to</acronym> gtk_list_store_new]</emphasis></para><refsect3 id="gtk-list-store-newv.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>n_columns</para></entry>
<entry role="parameter_description"><para>number of columns in the list store</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>types</para></entry>
<entry role="parameter_description"><para>an array of <link linkend="GType"><type>GType</type></link> types for the columns, from first to last. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_columns]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-list-store-newv.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GtkListStore"><type>GtkListStore</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-set-column-types" role="function">
<title>gtk_list_store_set_column_types&#160;()</title>
<indexterm zone="gtk-list-store-set-column-types"><primary>gtk_list_store_set_column_types</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_set_column_types (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                                 <parameter><link linkend="gint"><type>gint</type></link> n_columns</parameter>,
                                 <parameter><link linkend="GType"><type>GType</type></link> *types</parameter>);</programlisting>
<para>This function is meant primarily for <link linkend="GObjects"><type>GObjects</type></link> that inherit from <link linkend="GtkListStore"><type>GtkListStore</type></link>,
and should only be used when constructing a new <link linkend="GtkListStore"><type>GtkListStore</type></link>.  It will not
function after a row has been added, or a method on the <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>
interface is called.</para>
<refsect3 id="gtk-list-store-set-column-types.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_columns</para></entry>
<entry role="parameter_description"><para>Number of columns for the list store</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>types</para></entry>
<entry role="parameter_description"><para>An array length n of <link linkend="GTypes"><type>GTypes</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_columns]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-set" role="function">
<title>gtk_list_store_set&#160;()</title>
<indexterm zone="gtk-list-store-set"><primary>gtk_list_store_set</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_set (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                    <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                    <parameter>...</parameter>);</programlisting>
<para>Sets the value of one or more cells in the row referenced by <parameter>iter</parameter>
.
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
<link linkend="G-TYPE-STRING:CAPS"><literal>G_TYPE_STRING</literal></link> to “Foo”, you would write <literal>gtk_list_store_set (store, iter,
0, "Foo", -1)</literal>.</para>
<para>The value will be referenced by the store if it is a <link linkend="G-TYPE-OBJECT:CAPS"><literal>G_TYPE_OBJECT</literal></link>, and it
will be copied if it is a <link linkend="G-TYPE-STRING:CAPS"><literal>G_TYPE_STRING</literal></link> or <link linkend="G-TYPE-BOXED:CAPS"><literal>G_TYPE_BOXED</literal></link>.</para>
<refsect3 id="gtk-list-store-set.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>row iterator</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>pairs of column number and value, terminated with -1</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-set-valist" role="function">
<title>gtk_list_store_set_valist&#160;()</title>
<indexterm zone="gtk-list-store-set-valist"><primary>gtk_list_store_set_valist</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_set_valist (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                           <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                           <parameter><link linkend="va-list"><type>va_list</type></link> var_args</parameter>);</programlisting>
<para>See <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link>; this version takes a va_list for use by language
bindings.</para>
<refsect3 id="gtk-list-store-set-valist.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> for the row being modified</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>var_args</para></entry>
<entry role="parameter_description"><para>va_list of column/value pairs</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-set-value" role="function">
<title>gtk_list_store_set_value&#160;()</title>
<indexterm zone="gtk-list-store-set-value"><primary>gtk_list_store_set_value</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_set_value (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                          <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                          <parameter><link linkend="gint"><type>gint</type></link> column</parameter>,
                          <parameter><link linkend="GValue"><type>GValue</type></link> *value</parameter>);</programlisting>
<para>Sets the data in the cell specified by <parameter>iter</parameter>
 and <parameter>column</parameter>
.
The type of <parameter>value</parameter>
 must be convertible to the type of the
column.</para>
<refsect3 id="gtk-list-store-set-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> for the row being modified</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>column</para></entry>
<entry role="parameter_description"><para>column number to modify</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>new value for the cell</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-set-valuesv" role="function">
<title>gtk_list_store_set_valuesv&#160;()</title>
<indexterm zone="gtk-list-store-set-valuesv"><primary>gtk_list_store_set_valuesv</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_set_valuesv (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                            <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                            <parameter><link linkend="gint"><type>gint</type></link> *columns</parameter>,
                            <parameter><link linkend="GValue"><type>GValue</type></link> *values</parameter>,
                            <parameter><link linkend="gint"><type>gint</type></link> n_values</parameter>);</programlisting>
<para>A variant of <link linkend="gtk-list-store-set-valist"><function>gtk_list_store_set_valist()</function></link> 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.</para>

<para><emphasis role="annotation">[<acronym>rename-to</acronym> gtk_list_store_set]</emphasis></para><refsect3 id="gtk-list-store-set-valuesv.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> for the row being modified</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>columns</para></entry>
<entry role="parameter_description"><para>an array of column numbers. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_values]</emphasis></entry></row>
<row><entry role="parameter_name"><para>values</para></entry>
<entry role="parameter_description"><para>an array of GValues. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_values]</emphasis></entry></row>
<row><entry role="parameter_name"><para>n_values</para></entry>
<entry role="parameter_description"><para>the length of the <parameter>columns</parameter>
and <parameter>values</parameter>
arrays</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-remove" role="function">
<title>gtk_list_store_remove&#160;()</title>
<indexterm zone="gtk-list-store-remove"><primary>gtk_list_store_remove</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_list_store_remove (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                       <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>);</programlisting>
<para>Removes the given row from the list store.  After being removed, 
<parameter>iter</parameter>
 is set to be the next valid row, or invalidated if it pointed 
to the last row in <parameter>list_store</parameter>
.</para>
<refsect3 id="gtk-list-store-remove.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-list-store-remove.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>iter</parameter>
is valid, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if not.</para>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-insert" role="function">
<title>gtk_list_store_insert&#160;()</title>
<indexterm zone="gtk-list-store-insert"><primary>gtk_list_store_insert</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_insert (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                       <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                       <parameter><link linkend="gint"><type>gint</type></link> position</parameter>);</programlisting>
<para>Creates a new row at <parameter>position</parameter>
.  <parameter>iter</parameter>
 will be changed to point to this new
row.  If <parameter>position</parameter>
 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
<link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link> or <link linkend="gtk-list-store-set-value"><function>gtk_list_store_set_value()</function></link>.</para>
<refsect3 id="gtk-list-store-insert.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the new row. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>position to insert the new row, or -1 for last</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-insert-before" role="function">
<title>gtk_list_store_insert_before&#160;()</title>
<indexterm zone="gtk-list-store-insert-before"><primary>gtk_list_store_insert_before</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_insert_before (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                              <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                              <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *sibling</parameter>);</programlisting>
<para>Inserts a new row before <parameter>sibling</parameter>
. If <parameter>sibling</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then the row will 
be appended to the end of the list. <parameter>iter</parameter>
 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 <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link> or <link linkend="gtk-list-store-set-value"><function>gtk_list_store_set_value()</function></link>.</para>
<refsect3 id="gtk-list-store-insert-before.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the new row. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>sibling</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-insert-after" role="function">
<title>gtk_list_store_insert_after&#160;()</title>
<indexterm zone="gtk-list-store-insert-after"><primary>gtk_list_store_insert_after</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_insert_after (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                             <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                             <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *sibling</parameter>);</programlisting>
<para>Inserts a new row after <parameter>sibling</parameter>
. If <parameter>sibling</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, then the row will be
prepended to the beginning of the list. <parameter>iter</parameter>
 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 <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link> or <link linkend="gtk-list-store-set-value"><function>gtk_list_store_set_value()</function></link>.</para>
<refsect3 id="gtk-list-store-insert-after.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the new row. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>sibling</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-insert-with-values" role="function">
<title>gtk_list_store_insert_with_values&#160;()</title>
<indexterm zone="gtk-list-store-insert-with-values"><primary>gtk_list_store_insert_with_values</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_insert_with_values (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                                   <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                                   <parameter><link linkend="gint"><type>gint</type></link> position</parameter>,
                                   <parameter>...</parameter>);</programlisting>
<para>Creates a new row at <parameter>position</parameter>
. <parameter>iter</parameter>
 will be changed to point to this new
row. If <parameter>position</parameter>
 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.</para>
<para>Calling
<literal>gtk_list_store_insert_with_values (list_store, iter, position...)</literal>
has the same effect as calling</para>
<informalexample><programlisting role="example"><![CDATA[
static void
insert_value (GtkListStore *list_store,
              GtkTreeIter  *iter,
              int           position)
{
  gtk_list_store_insert (list_store, iter, position);
  gtk_list_store_set (list_store,
                      iter
                      // ...
                      );
}
]]></programlisting></informalexample>
<para>
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,
<link linkend="gtk-list-store-insert-with-values"><function>gtk_list_store_insert_with_values()</function></link> should generally be preferred when
inserting rows in a sorted list store.</para>
<refsect3 id="gtk-list-store-insert-with-values.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the new row, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>position to insert the new row, or -1 to append after existing
rows</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>pairs of column number and value, terminated with -1</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-insert-with-valuesv" role="function">
<title>gtk_list_store_insert_with_valuesv&#160;()</title>
<indexterm zone="gtk-list-store-insert-with-valuesv"><primary>gtk_list_store_insert_with_valuesv</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_insert_with_valuesv (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                                    <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                                    <parameter><link linkend="gint"><type>gint</type></link> position</parameter>,
                                    <parameter><link linkend="gint"><type>gint</type></link> *columns</parameter>,
                                    <parameter><link linkend="GValue"><type>GValue</type></link> *values</parameter>,
                                    <parameter><link linkend="gint"><type>gint</type></link> n_values</parameter>);</programlisting>
<para>A variant of <link linkend="gtk-list-store-insert-with-values"><function>gtk_list_store_insert_with_values()</function></link> which
takes the columns and values as two arrays, instead of
varargs. This function is mainly intended for 
language-bindings.</para>
<refsect3 id="gtk-list-store-insert-with-valuesv.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the new row, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>position to insert the new row, or -1 for last</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>columns</para></entry>
<entry role="parameter_description"><para>an array of column numbers. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_values]</emphasis></entry></row>
<row><entry role="parameter_name"><para>values</para></entry>
<entry role="parameter_description"><para>an array of GValues. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> length=n_values]</emphasis></entry></row>
<row><entry role="parameter_name"><para>n_values</para></entry>
<entry role="parameter_description"><para>the length of the <parameter>columns</parameter>
and <parameter>values</parameter>
arrays</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-prepend" role="function">
<title>gtk_list_store_prepend&#160;()</title>
<indexterm zone="gtk-list-store-prepend"><primary>gtk_list_store_prepend</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_prepend (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                        <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>);</programlisting>
<para>Prepends a new row to <parameter>list_store</parameter>
. <parameter>iter</parameter>
 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 <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link> or <link linkend="gtk-list-store-set-value"><function>gtk_list_store_set_value()</function></link>.</para>
<refsect3 id="gtk-list-store-prepend.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the prepend row. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-append" role="function">
<title>gtk_list_store_append&#160;()</title>
<indexterm zone="gtk-list-store-append"><primary>gtk_list_store_append</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_append (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                       <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>);</programlisting>
<para>Appends a new row to <parameter>list_store</parameter>
.  <parameter>iter</parameter>
 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 <link linkend="gtk-list-store-set"><function>gtk_list_store_set()</function></link> or <link linkend="gtk-list-store-set-value"><function>gtk_list_store_set_value()</function></link>.</para>
<refsect3 id="gtk-list-store-append.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>An unset <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> to set to the appended row. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-clear" role="function">
<title>gtk_list_store_clear&#160;()</title>
<indexterm zone="gtk-list-store-clear"><primary>gtk_list_store_clear</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_clear (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>);</programlisting>
<para>Removes all rows from the list store.</para>
<refsect3 id="gtk-list-store-clear.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-iter-is-valid" role="function">
<title>gtk_list_store_iter_is_valid&#160;()</title>
<indexterm zone="gtk-list-store-iter-is-valid"><primary>gtk_list_store_iter_is_valid</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_list_store_iter_is_valid (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *list_store</parameter>,
                              <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>);</programlisting>
<blockquote>
<para>This function is slow. Only use it for debugging and/or testing
purposes.</para>
</blockquote>
<para>Checks if the given iter is a valid iter for this <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para>
<refsect3 id="gtk-list-store-iter-is-valid.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>list_store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-list-store-iter-is-valid.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the iter is valid, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if the iter is invalid.</para>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-reorder" role="function">
<title>gtk_list_store_reorder&#160;()</title>
<indexterm zone="gtk-list-store-reorder"><primary>gtk_list_store_reorder</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_reorder (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *store</parameter>,
                        <parameter><link linkend="gint"><type>gint</type></link> *new_order</parameter>);</programlisting>
<para>Reorders <parameter>store</parameter>
 to follow the order indicated by <parameter>new_order</parameter>
. Note that
this function only works with unsorted stores.</para>
<refsect3 id="gtk-list-store-reorder.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>new_order</para></entry>
<entry role="parameter_description"><para>an array of integers mapping the new
position of each child to its old position before the re-ordering,
i.e. <parameter>new_order</parameter>
<literal>[newpos] = oldpos</literal>. It must have
exactly as many items as the list store’s length. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>array</acronym> zero-terminated=1]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-swap" role="function">
<title>gtk_list_store_swap&#160;()</title>
<indexterm zone="gtk-list-store-swap"><primary>gtk_list_store_swap</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_swap (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *store</parameter>,
                     <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *a</parameter>,
                     <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *b</parameter>);</programlisting>
<para>Swaps <parameter>a</parameter>
 and <parameter>b</parameter>
 in <parameter>store</parameter>
. Note that this function only works with
unsorted stores.</para>
<refsect3 id="gtk-list-store-swap.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>a</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>b</para></entry>
<entry role="parameter_description"><para>Another <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-move-before" role="function">
<title>gtk_list_store_move_before&#160;()</title>
<indexterm zone="gtk-list-store-move-before"><primary>gtk_list_store_move_before</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_move_before (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *store</parameter>,
                            <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                            <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *position</parameter>);</programlisting>
<para>Moves <parameter>iter</parameter>
 in <parameter>store</parameter>
 to the position before <parameter>position</parameter>
. Note that this
function only works with unsorted stores. If <parameter>position</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <parameter>iter</parameter>

will be moved to the end of the list.</para>
<refsect3 id="gtk-list-store-move-before.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-list-store-move-after" role="function">
<title>gtk_list_store_move_after&#160;()</title>
<indexterm zone="gtk-list-store-move-after"><primary>gtk_list_store_move_after</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_list_store_move_after (<parameter><link linkend="GtkListStore"><type>GtkListStore</type></link> *store</parameter>,
                           <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                           <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *position</parameter>);</programlisting>
<para>Moves <parameter>iter</parameter>
 in <parameter>store</parameter>
 to the position after <parameter>position</parameter>
. Note that this
function only works with unsorted stores. If <parameter>position</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <parameter>iter</parameter>

will be moved to the start of the list.</para>
<refsect3 id="gtk-list-store-move-after.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>store</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkListStore"><type>GtkListStore</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkListStore.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkListStore-struct" role="struct">
<title>struct GtkListStore</title>
<indexterm zone="GtkListStore-struct"><primary>GtkListStore</primary></indexterm>
<programlisting language="C">struct GtkListStore;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkListStore.see-also">
<title>See Also</title>
<para><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>, <link linkend="GtkTreeStore"><type>GtkTreeStore</type></link></para>

</refsect1>

</refentry>
