<?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="GtkNumericSorter">
<refmeta>
<refentrytitle role="top_of_page" id="GtkNumericSorter.top_of_page">GtkNumericSorter</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkNumericSorter</refname>
<refpurpose>Sort by comparing numbers</refpurpose>
</refnamediv>

<refsect1 id="GtkNumericSorter.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="GtkNumericSorter"><returnvalue>GtkNumericSorter</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-numeric-sorter-new">gtk_numeric_sorter_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkExpression"><returnvalue>GtkExpression</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-numeric-sorter-get-expression">gtk_numeric_sorter_get_expression</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-numeric-sorter-set-expression">gtk_numeric_sorter_set_expression</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkSortType"><returnvalue>GtkSortType</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-numeric-sorter-get-sort-order">gtk_numeric_sorter_get_sort_order</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-numeric-sorter-set-sort-order">gtk_numeric_sorter_set_sort_order</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkNumericSorter.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="GtkExpression"><type>GtkExpression</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkNumericSorter--expression">expression</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GtkSortType"><type>GtkSortType</type></link></entry><entry role="property_name"><link linkend="GtkNumericSorter--sort-order">sort-order</link></entry><entry role="property_flags">Read / Write</entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkNumericSorter.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> <link linkend="GtkSorter">GtkSorter</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkNumericSorter
</screen>
</refsect1>

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

<refsect1 id="GtkNumericSorter.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkNumericSorter is a <link linkend="GtkSorter"><type>GtkSorter</type></link> that compares numbers.</para>
<para>To obtain the numbers to compare, this sorter evaluates a <link linkend="GtkExpression"><type>GtkExpression</type></link>.</para>

</refsect1>
<refsect1 id="GtkNumericSorter.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-numeric-sorter-new" role="function">
<title>gtk_numeric_sorter_new&#160;()</title>
<indexterm zone="gtk-numeric-sorter-new"><primary>gtk_numeric_sorter_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkNumericSorter"><returnvalue>GtkNumericSorter</returnvalue></link>&#160;*
gtk_numeric_sorter_new (<parameter><link linkend="GtkExpression"><type>GtkExpression</type></link> *expression</parameter>);</programlisting>
<para>Creates a new numeric sorter using the given <parameter>expression</parameter>
.</para>
<para>Smaller numbers will be sorted first. You can call
<link linkend="gtk-numeric-sorter-set-sort-order"><function>gtk_numeric_sorter_set_sort_order()</function></link> to change this.</para>
<refsect3 id="gtk-numeric-sorter-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>expression</para></entry>
<entry role="parameter_description"><para>The expression to evaluate. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-numeric-sorter-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-numeric-sorter-get-expression" role="function">
<title>gtk_numeric_sorter_get_expression&#160;()</title>
<indexterm zone="gtk-numeric-sorter-get-expression"><primary>gtk_numeric_sorter_get_expression</primary></indexterm>
<programlisting language="C"><link linkend="GtkExpression"><returnvalue>GtkExpression</returnvalue></link>&#160;*
gtk_numeric_sorter_get_expression (<parameter><link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link> *self</parameter>);</programlisting>
<para>Gets the expression that is evaluated to obtain numbers from items.</para>
<refsect3 id="gtk-numeric-sorter-get-expression.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-numeric-sorter-get-expression.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GtkExpression"><type>GtkExpression</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-numeric-sorter-set-expression" role="function">
<title>gtk_numeric_sorter_set_expression&#160;()</title>
<indexterm zone="gtk-numeric-sorter-set-expression"><primary>gtk_numeric_sorter_set_expression</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_numeric_sorter_set_expression (<parameter><link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link> *self</parameter>,
                                   <parameter><link linkend="GtkExpression"><type>GtkExpression</type></link> *expression</parameter>);</programlisting>
<para>Sets the expression that is evaluated to obtain numbers from items.</para>
<para>Unless an expression is set on <parameter>self</parameter>
, the sorter will always
compare items as invalid.</para>
<para>The expression must have a return type that can be compared
numerically, such as <link linkend="G-TYPE-INT:CAPS"><type>G_TYPE_INT</type></link> or <link linkend="G-TYPE-DOUBLE:CAPS"><type>G_TYPE_DOUBLE</type></link>.</para>
<refsect3 id="gtk-numeric-sorter-set-expression.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>expression</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkExpression"><type>GtkExpression</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-numeric-sorter-get-sort-order" role="function">
<title>gtk_numeric_sorter_get_sort_order&#160;()</title>
<indexterm zone="gtk-numeric-sorter-get-sort-order"><primary>gtk_numeric_sorter_get_sort_order</primary></indexterm>
<programlisting language="C"><link linkend="GtkSortType"><returnvalue>GtkSortType</returnvalue></link>
gtk_numeric_sorter_get_sort_order (<parameter><link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link> *self</parameter>);</programlisting>
<para>Gets whether this sorter will sort smaller numbers first.</para>
<refsect3 id="gtk-numeric-sorter-get-sort-order.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-numeric-sorter-get-sort-order.returns" role="returns">
<title>Returns</title>
<para> the order of the numbers</para>
</refsect3></refsect2>
<refsect2 id="gtk-numeric-sorter-set-sort-order" role="function">
<title>gtk_numeric_sorter_set_sort_order&#160;()</title>
<indexterm zone="gtk-numeric-sorter-set-sort-order"><primary>gtk_numeric_sorter_set_sort_order</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_numeric_sorter_set_sort_order (<parameter><link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link> *self</parameter>,
                                   <parameter><link linkend="GtkSortType"><type>GtkSortType</type></link> sort_order</parameter>);</programlisting>
<para>Sets whether to sort smaller numbers before larger ones.</para>
<refsect3 id="gtk-numeric-sorter-set-sort-order.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkNumericSorter"><type>GtkNumericSorter</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>sort_order</para></entry>
<entry role="parameter_description"><para>whether to sort smaller numbers first</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkNumericSorter.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkNumericSorter--expression" role="property"><title>The <literal>“expression”</literal> property</title>
<indexterm zone="GtkNumericSorter--expression"><primary>GtkNumericSorter:expression</primary></indexterm>
<programlisting>  “expression”               <link linkend="GtkExpression"><type>GtkExpression</type></link>&#160;*</programlisting>
<para>The expression to evaluate on items to get a number to compare with</para>

<para><emphasis role="annotation">[<acronym>type</acronym> GtkExpression]</emphasis></para><para>Owner: GtkNumericSorter</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkNumericSorter--sort-order" role="property"><title>The <literal>“sort-order”</literal> property</title>
<indexterm zone="GtkNumericSorter--sort-order"><primary>GtkNumericSorter:sort-order</primary></indexterm>
<programlisting>  “sort-order”               <link linkend="GtkSortType"><type>GtkSortType</type></link></programlisting>
<para>Whether the sorter will sort smaller numbers first</para>
<para>Owner: GtkNumericSorter</para>
<para>Flags: Read / Write</para>
<para>Default value: GTK_SORT_ASCENDING</para>
</refsect2>

</refsect1>
<refsect1 id="GtkNumericSorter.see-also">
<title>See Also</title>
<para><link linkend="GtkExpression"><type>GtkExpression</type></link></para>

</refsect1>

</refentry>
