<?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="GtkTreeModelSort">
<refmeta>
<refentrytitle role="top_of_page" id="GtkTreeModelSort.top_of_page">GtkTreeModelSort</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkTreeModelSort</refname>
<refpurpose>A GtkTreeModel which makes an underlying tree model sortable</refpurpose>
</refnamediv>

<refsect1 id="GtkTreeModelSort.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="GtkTreeModel"><returnvalue>GtkTreeModel</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-model-sort-new-with-model">gtk_tree_model_sort_new_with_model</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTreeModel"><returnvalue>GtkTreeModel</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-model-sort-get-model">gtk_tree_model_sort_get_model</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTreePath"><returnvalue>GtkTreePath</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-model-sort-convert-child-path-to-path">gtk_tree_model_sort_convert_child_path_to_path</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-tree-model-sort-convert-child-iter-to-iter">gtk_tree_model_sort_convert_child_iter_to_iter</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTreePath"><returnvalue>GtkTreePath</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-model-sort-convert-path-to-child-path">gtk_tree_model_sort_convert_path_to_child_path</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-tree-model-sort-convert-iter-to-child-iter">gtk_tree_model_sort_convert_iter_to_child_iter</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-tree-model-sort-reset-default-sort-func">gtk_tree_model_sort_reset_default_sort_func</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-tree-model-sort-clear-cache">gtk_tree_model_sort_clear_cache</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-tree-model-sort-iter-is-valid">gtk_tree_model_sort_iter_is_valid</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeModelSort.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkTreeModelSort--model">model</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeModelSort.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="GtkTreeModelSort-struct">GtkTreeModelSort</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeModelSort.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> GtkTreeModelSort
</screen>
</refsect1>
<refsect1 id="GtkTreeModelSort.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkTreeModelSort implements
 <link linkend="GtkTreeModel">GtkTreeModel</link>,  <link linkend="GtkTreeSortable">GtkTreeSortable</link> and  <link linkend="GtkTreeDragSource">GtkTreeDragSource</link>.</para>

</refsect1>

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

<refsect1 id="GtkTreeModelSort.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> is a model which implements the <link linkend="GtkTreeSortable"><type>GtkTreeSortable</type></link>
interface.  It does not hold any data itself, but rather is created with
a child model and proxies its data.  It has identical column types to
this child model, and the changes in the child are propagated.  The
primary purpose of this model is to provide a way to sort a different
model without modifying it. Note that the sort function used by
<link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> is not guaranteed to be stable.</para>
<para>The use of this is best demonstrated through an example.  In the
following sample code we create two <link linkend="GtkTreeView"><type>GtkTreeView</type></link> widgets each with a
view of the same data.  As the model is wrapped here by a
<link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link>, the two <link linkend="GtkTreeViews"><type>GtkTreeViews</type></link> can each sort their
view of the data without affecting the other.  By contrast, if we
simply put the same model in each widget, then sorting the first would
sort the second.</para>
<refsect3><title>Using a <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></title><informalexample><programlisting role="example"><![CDATA[
{
  GtkTreeView *tree_view1;
  GtkTreeView *tree_view2;
  GtkTreeModel *sort_model1;
  GtkTreeModel *sort_model2;
  GtkTreeModel *child_model;

  // get the child model
  child_model = get_my_model ();

  // Create the first tree
  sort_model1 = gtk_tree_model_sort_new_with_model (child_model);
  tree_view1 = gtk_tree_view_new_with_model (sort_model1);

  // Create the second tree
  sort_model2 = gtk_tree_model_sort_new_with_model (child_model);
  tree_view2 = gtk_tree_view_new_with_model (sort_model2);

  // Now we can sort the two models independently
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model1),
                                        COLUMN_1, GTK_SORT_ASCENDING);
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model2),
                                        COLUMN_1, GTK_SORT_DESCENDING);
}
]]></programlisting></informalexample>
<para></para>
<para>To demonstrate how to access the underlying child model from the sort
model, the next example will be a callback for the <link linkend="GtkTreeSelection"><type>GtkTreeSelection</type></link>
<link linkend="GtkTreeSelection-changed"><type>“changed”</type></link> signal.  In this callback, we get a string
from COLUMN_1 of the model.  We then modify the string, find the same
selected row on the child model, and change the row there.</para>
</refsect3>
<refsect3><title>Accessing the child model of in a selection changed callback</title><informalexample><programlisting role="example"><![CDATA[
void
selection_changed (GtkTreeSelection *selection, gpointer data)
{
  GtkTreeModel *sort_model = NULL;
  GtkTreeModel *child_model;
  GtkTreeIter sort_iter;
  GtkTreeIter child_iter;
  char *some_data = NULL;
  char *modified_data;

  // Get the current selected row and the model.
  if (! gtk_tree_selection_get_selected (selection,
                                         &sort_model,
                                         &sort_iter))
    return;

  // Look up the current value on the selected row and get
  // a new value to change it to.
  gtk_tree_model_get (GTK_TREE_MODEL (sort_model), &sort_iter,
                      COLUMN_1, &some_data,
                      -1);

  modified_data = change_the_data (some_data);
  g_free (some_data);

  // Get an iterator on the child model, instead of the sort model.
  gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (sort_model),
                                                  &child_iter,
                                                  &sort_iter);

  // Get the child model and change the value of the row. In this
  // example, the child model is a GtkListStore. It could be any other
  // type of model, though.
  child_model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (sort_model));
  gtk_list_store_set (GTK_LIST_STORE (child_model), &child_iter,
                      COLUMN_1, &modified_data,
                      -1);
  g_free (modified_data);
}
]]></programlisting></informalexample>
<para></para>
</refsect3>

</refsect1>
<refsect1 id="GtkTreeModelSort.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-tree-model-sort-new-with-model" role="function">
<title>gtk_tree_model_sort_new_with_model&#160;()</title>
<indexterm zone="gtk-tree-model-sort-new-with-model"><primary>gtk_tree_model_sort_new_with_model</primary></indexterm>
<programlisting language="C"><link linkend="GtkTreeModel"><returnvalue>GtkTreeModel</returnvalue></link>&#160;*
gtk_tree_model_sort_new_with_model (<parameter><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> *child_model</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link>, with <parameter>child_model</parameter>
 as the child model.</para>

<para><emphasis role="annotation">[<acronym>constructor</acronym>]</emphasis></para><refsect3 id="gtk-tree-model-sort-new-with-model.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>child_model</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-model-sort-new-with-model.returns" role="returns">
<title>Returns</title>
<para>A new <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>type</acronym> Gtk.TreeModelSort]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-get-model" role="function">
<title>gtk_tree_model_sort_get_model&#160;()</title>
<indexterm zone="gtk-tree-model-sort-get-model"><primary>gtk_tree_model_sort_get_model</primary></indexterm>
<programlisting language="C"><link linkend="GtkTreeModel"><returnvalue>GtkTreeModel</returnvalue></link>&#160;*
gtk_tree_model_sort_get_model (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model</parameter>);</programlisting>
<para>Returns the model the <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> is sorting.</para>
<refsect3 id="gtk-tree-model-sort-get-model.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>tree_model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-model-sort-get-model.returns" role="returns">
<title>Returns</title>
<para>the "child model" being sorted. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-convert-child-path-to-path" role="function">
<title>gtk_tree_model_sort_convert_child_path_to_path&#160;()</title>
<indexterm zone="gtk-tree-model-sort-convert-child-path-to-path"><primary>gtk_tree_model_sort_convert_child_path_to_path</primary></indexterm>
<programlisting language="C"><link linkend="GtkTreePath"><returnvalue>GtkTreePath</returnvalue></link>&#160;*
gtk_tree_model_sort_convert_child_path_to_path
                               (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>,
                                <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *child_path</parameter>);</programlisting>
<para>Converts <parameter>child_path</parameter>
 to a path relative to <parameter>tree_model_sort</parameter>
.  That is,
<parameter>child_path</parameter>
 points to a path in the child model.  The returned path will
point to the same row in the sorted model.  If <parameter>child_path</parameter>
 isn’t a valid 
path on the child model, then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="gtk-tree-model-sort-convert-child-path-to-path.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child_path</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreePath"><type>GtkTreePath</type></link> to convert</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-model-sort-convert-child-path-to-path.returns" role="returns">
<title>Returns</title>
<para>A newly allocated <link linkend="GtkTreePath"><type>GtkTreePath</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-convert-child-iter-to-iter" role="function">
<title>gtk_tree_model_sort_convert_child_iter_to_iter&#160;()</title>
<indexterm zone="gtk-tree-model-sort-convert-child-iter-to-iter"><primary>gtk_tree_model_sort_convert_child_iter_to_iter</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_model_sort_convert_child_iter_to_iter
                               (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>,
                                <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *sort_iter</parameter>,
                                <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *child_iter</parameter>);</programlisting>
<para>Sets <parameter>sort_iter</parameter>
 to point to the row in <parameter>tree_model_sort</parameter>
 that corresponds to
the row pointed at by <parameter>child_iter</parameter>
.  If <parameter>sort_iter</parameter>
 was not set, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
is returned.  Note: a boolean is only returned since 2.14.</para>
<refsect3 id="gtk-tree-model-sort-convert-child-iter-to-iter.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>sort_iter</para></entry>
<entry role="parameter_description"><para>An uninitialized <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>child_iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> pointing to a row on the child model</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-model-sort-convert-child-iter-to-iter.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, if <parameter>sort_iter</parameter>
was set, i.e. if <parameter>sort_iter</parameter>
is a
valid iterator pointer to a visible row in the child model.</para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-convert-path-to-child-path" role="function">
<title>gtk_tree_model_sort_convert_path_to_child_path&#160;()</title>
<indexterm zone="gtk-tree-model-sort-convert-path-to-child-path"><primary>gtk_tree_model_sort_convert_path_to_child_path</primary></indexterm>
<programlisting language="C"><link linkend="GtkTreePath"><returnvalue>GtkTreePath</returnvalue></link>&#160;*
gtk_tree_model_sort_convert_path_to_child_path
                               (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>,
                                <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *sorted_path</parameter>);</programlisting>
<para>Converts <parameter>sorted_path</parameter>
 to a path on the child model of <parameter>tree_model_sort</parameter>
.  
That is, <parameter>sorted_path</parameter>
 points to a location in <parameter>tree_model_sort</parameter>
.  The 
returned path will point to the same location in the model not being 
sorted.  If <parameter>sorted_path</parameter>
 does not point to a location in the child model, 
<link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="gtk-tree-model-sort-convert-path-to-child-path.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>sorted_path</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreePath"><type>GtkTreePath</type></link> to convert</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-model-sort-convert-path-to-child-path.returns" role="returns">
<title>Returns</title>
<para>A newly allocated <link linkend="GtkTreePath"><type>GtkTreePath</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-convert-iter-to-child-iter" role="function">
<title>gtk_tree_model_sort_convert_iter_to_child_iter&#160;()</title>
<indexterm zone="gtk-tree-model-sort-convert-iter-to-child-iter"><primary>gtk_tree_model_sort_convert_iter_to_child_iter</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_tree_model_sort_convert_iter_to_child_iter
                               (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>,
                                <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *child_iter</parameter>,
                                <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *sorted_iter</parameter>);</programlisting>
<para>Sets <parameter>child_iter</parameter>
 to point to the row pointed to by <parameter>sorted_iter</parameter>
.</para>
<refsect3 id="gtk-tree-model-sort-convert-iter-to-child-iter.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child_iter</para></entry>
<entry role="parameter_description"><para>An uninitialized <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>sorted_iter</para></entry>
<entry role="parameter_description"><para>A valid <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> pointing to a row on <parameter>tree_model_sort</parameter>
.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-reset-default-sort-func" role="function">
<title>gtk_tree_model_sort_reset_default_sort_func&#160;()</title>
<indexterm zone="gtk-tree-model-sort-reset-default-sort-func"><primary>gtk_tree_model_sort_reset_default_sort_func</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_tree_model_sort_reset_default_sort_func
                               (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>);</programlisting>
<para>This resets the default sort function to be in the “unsorted” state.  That
is, it is in the same order as the child model. It will re-sort the model
to be in the same order as the child model only if the <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link>
is in “unsorted” state.</para>
<refsect3 id="gtk-tree-model-sort-reset-default-sort-func.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-clear-cache" role="function">
<title>gtk_tree_model_sort_clear_cache&#160;()</title>
<indexterm zone="gtk-tree-model-sort-clear-cache"><primary>gtk_tree_model_sort_clear_cache</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_tree_model_sort_clear_cache (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</parameter>);</programlisting>
<para>This function should almost never be called.  It clears the <parameter>tree_model_sort</parameter>

of any cached iterators that haven’t been reffed with
<link linkend="gtk-tree-model-ref-node"><function>gtk_tree_model_ref_node()</function></link>.  This might be useful if the child model being
sorted is static (and doesn’t change often) and there has been a lot of
unreffed access to nodes.  As a side effect of this function, all unreffed
iters will be invalid.</para>
<refsect3 id="gtk-tree-model-sort-clear-cache.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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-tree-model-sort-iter-is-valid" role="function">
<title>gtk_tree_model_sort_iter_is_valid&#160;()</title>
<indexterm zone="gtk-tree-model-sort-iter-is-valid"><primary>gtk_tree_model_sort_iter_is_valid</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_model_sort_iter_is_valid (<parameter><link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</type></link> *tree_model_sort</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="GtkTreeModelSort"><type>GtkTreeModelSort</type></link>.</para>
<refsect3 id="gtk-tree-model-sort-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>tree_model_sort</para></entry>
<entry role="parameter_description"><para>A <link linkend="GtkTreeModelSort"><type>GtkTreeModelSort</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-tree-model-sort-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>

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

</refsect1>
<refsect1 id="GtkTreeModelSort.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkTreeModelSort--model" role="property"><title>The <literal>“model”</literal> property</title>
<indexterm zone="GtkTreeModelSort--model"><primary>GtkTreeModelSort:model</primary></indexterm>
<programlisting>  “model”                    <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>&#160;*</programlisting>
<para>The model for the TreeModelSort to sort.</para><para>Owner: GtkTreeModelSort</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
</refsect2>

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

</refsect1>

</refentry>
