<?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="GtkSelectionModel">
<refmeta>
<refentrytitle role="top_of_page" id="GtkSelectionModel.top_of_page">GtkSelectionModel</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkSelectionModel</refname>
<refpurpose>An extension of the list model interface that handles selections</refpurpose>
</refnamediv>

<refsect1 id="GtkSelectionModel.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="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-selection-model-is-selected">gtk_selection_model_is_selected</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-selection-model-select-item">gtk_selection_model_select_item</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-selection-model-unselect-item">gtk_selection_model_unselect_item</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-selection-model-select-range">gtk_selection_model_select_range</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-selection-model-unselect-range">gtk_selection_model_unselect_range</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-selection-model-select-all">gtk_selection_model_select_all</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-selection-model-unselect-all">gtk_selection_model_unselect_all</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-selection-model-query-range">gtk_selection_model_query_range</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-selection-model-selection-changed">gtk_selection_model_selection_changed</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkSelectionModel.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkSelectionModel-selection-changed">selection-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkSelectionModel.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkSelectionModel
</screen>
</refsect1>
<refsect1 id="GtkSelectionModel.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GtkSelectionModel requires
 <link linkend="GListModel">GListModel</link> and  <link linkend="GObject">GObject</link>.</para>

</refsect1>
<refsect1 id="GtkSelectionModel.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkSelectionModel is implemented by
 <link linkend="GtkNoSelection">GtkNoSelection</link> and  <link linkend="GtkSingleSelection">GtkSingleSelection</link>.</para>

</refsect1>

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

<refsect1 id="GtkSelectionModel.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> is an interface that extends the <link linkend="GListModel"><type>GListModel</type></link> interface by adding
support for selections. This support is then used by widgets using list models to add
the ability to select and unselect various items.</para>
<para>GTK provides default implementations of the mode common selection modes such as
<link linkend="GtkSingleSelection"><type>GtkSingleSelection</type></link>, so you will only need to implement this interface if you want
detailed control about how selections should be handled.</para>
<para>A <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> supports a single boolean per row indicating if a row is selected
or not. This can be queried via <link linkend="gtk-selection-model-is-selected"><function>gtk_selection_model_is_selected()</function></link>. When the selected
state of one or more rows changes, the model will emit the
<link linkend="GtkSelectionModel-selection-changed"><type>“selection-changed”</type></link> signal by calling the
<link linkend="gtk-selection-model-selection-changed"><function>gtk_selection_model_selection_changed()</function></link> function. The positions given in that signal
may have their selection state changed, though that is not a requirement.  
If new items added to the model via the <link linkend="GListModel-items-changed"><type>“items-changed”</type></link> signal are selected
or not is up to the implementation.</para>
<para>Additionally, the interface can expose functionality to select and unselect items.
If these functions are implemented, GTK's list widgets will allow users to select and
unselect items. However, <link linkend="GtkSelectionModels"><type>GtkSelectionModels</type></link> are free to only implement them
partially or not at all. In that case the widgets will not support the unimplemented
operations.</para>
<para>When selecting or unselecting is supported by a model, the return values of the
selection functions do NOT indicate if selection or unselection happened. They are
only meant to indicate complete failure, like when this mode of selecting is not
supported by the model.</para>
<para>Selections may happen asynchronously, so the only reliable way to find out when an
item was selected is to listen to the signals that indicate selection.</para>

</refsect1>
<refsect1 id="GtkSelectionModel.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-selection-model-is-selected" role="function">
<title>gtk_selection_model_is_selected&#160;()</title>
<indexterm zone="gtk-selection-model-is-selected"><primary>gtk_selection_model_is_selected</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_is_selected (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                 <parameter><link linkend="guint"><type>guint</type></link> position</parameter>);</programlisting>
<para>Checks if the given item is selected.</para>
<refsect3 id="gtk-selection-model-is-selected.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the position of the item to query</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-selection-model-is-selected.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the item is selected</para>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-select-item" role="function">
<title>gtk_selection_model_select_item&#160;()</title>
<indexterm zone="gtk-selection-model-select-item"><primary>gtk_selection_model_select_item</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_select_item (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                 <parameter><link linkend="guint"><type>guint</type></link> position</parameter>,
                                 <parameter><link linkend="gboolean"><type>gboolean</type></link> exclusive</parameter>);</programlisting>
<para>Requests to select an item in the model.</para>
<refsect3 id="gtk-selection-model-select-item.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the position of the item to select</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>exclusive</para></entry>
<entry role="parameter_description"><para>whether previously selected items should be unselected</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-unselect-item" role="function">
<title>gtk_selection_model_unselect_item&#160;()</title>
<indexterm zone="gtk-selection-model-unselect-item"><primary>gtk_selection_model_unselect_item</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_unselect_item (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                   <parameter><link linkend="guint"><type>guint</type></link> position</parameter>);</programlisting>
<para>Requests to unselect an item in the model.</para>
<refsect3 id="gtk-selection-model-unselect-item.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the position of the item to unselect</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-select-range" role="function">
<title>gtk_selection_model_select_range&#160;()</title>
<indexterm zone="gtk-selection-model-select-range"><primary>gtk_selection_model_select_range</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_select_range (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                  <parameter><link linkend="guint"><type>guint</type></link> position</parameter>,
                                  <parameter><link linkend="guint"><type>guint</type></link> n_items</parameter>,
                                  <parameter><link linkend="gboolean"><type>gboolean</type></link> exclusive</parameter>);</programlisting>
<para>Requests to select a range of items in the model.</para>
<refsect3 id="gtk-selection-model-select-range.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the first item to select</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_items</para></entry>
<entry role="parameter_description"><para>the number of items to select</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>exclusive</para></entry>
<entry role="parameter_description"><para>whether previously selected items should be unselected</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-unselect-range" role="function">
<title>gtk_selection_model_unselect_range&#160;()</title>
<indexterm zone="gtk-selection-model-unselect-range"><primary>gtk_selection_model_unselect_range</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_unselect_range (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                    <parameter><link linkend="guint"><type>guint</type></link> position</parameter>,
                                    <parameter><link linkend="guint"><type>guint</type></link> n_items</parameter>);</programlisting>
<para>Requests to unselect a range of items in the model.</para>
<refsect3 id="gtk-selection-model-unselect-range.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the first item to unselect</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_items</para></entry>
<entry role="parameter_description"><para>the number of items to unselect</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-select-all" role="function">
<title>gtk_selection_model_select_all&#160;()</title>
<indexterm zone="gtk-selection-model-select-all"><primary>gtk_selection_model_select_all</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_select_all (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>);</programlisting>
<para>Requests to select all items in the model.</para>
<refsect3 id="gtk-selection-model-select-all.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-unselect-all" role="function">
<title>gtk_selection_model_unselect_all&#160;()</title>
<indexterm zone="gtk-selection-model-unselect-all"><primary>gtk_selection_model_unselect_all</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_selection_model_unselect_all (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>);</programlisting>
<para>Requests to unselect all items in the model.</para>
<refsect3 id="gtk-selection-model-unselect-all.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-query-range" role="function">
<title>gtk_selection_model_query_range&#160;()</title>
<indexterm zone="gtk-selection-model-query-range"><primary>gtk_selection_model_query_range</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_selection_model_query_range (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                 <parameter><link linkend="guint"><type>guint</type></link> position</parameter>,
                                 <parameter><link linkend="guint"><type>guint</type></link> *start_range</parameter>,
                                 <parameter><link linkend="guint"><type>guint</type></link> *n_items</parameter>,
                                 <parameter><link linkend="gboolean"><type>gboolean</type></link> *selected</parameter>);</programlisting>
<para>This function allows to query the selection status of multiple elements at once.
It is passed a position and returns a range of elements of uniform selection status.</para>
<para>If <parameter>position</parameter>
 is greater than the number of items in <parameter>model</parameter>
, <parameter>n_items</parameter>
 is set to 0.
Otherwise the returned range is guaranteed to include the passed-in position, so
<parameter>n_items</parameter>
 will be &gt;= 1.</para>
<para>Positions directly adjacent to the returned range may have the same selection
status as the returned range.</para>
<para>This is an optimization function to make iterating over a model faster when few
items are selected. However, it is valid behavior for implementations to use a
naive implementation that only ever returns a single element.</para>
<refsect3 id="gtk-selection-model-query-range.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the position inside the range</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>start_range</para></entry>
<entry role="parameter_description"><para>returns the position of the first element of the range. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>n_items</para></entry>
<entry role="parameter_description"><para>returns the size of the range. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>selected</para></entry>
<entry role="parameter_description"><para>returns whether items in <parameter>range</parameter>
are selected. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-selection-model-selection-changed" role="function">
<title>gtk_selection_model_selection_changed&#160;()</title>
<indexterm zone="gtk-selection-model-selection-changed"><primary>gtk_selection_model_selection_changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_selection_model_selection_changed (<parameter><link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model</parameter>,
                                       <parameter><link linkend="guint"><type>guint</type></link> position</parameter>,
                                       <parameter><link linkend="guint"><type>guint</type></link> n_items</parameter>);</programlisting>
<para>Helper function for implementations of <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link>.
Call this when a the selection changes to emit the ::selection-changed
signal.</para>
<refsect3 id="gtk-selection-model-selection-changed.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>the first changed item</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_items</para></entry>
<entry role="parameter_description"><para>the number of changed items</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkSelectionModel.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkSelectionModel-selection-changed" role="signal"><title>The <literal>“selection-changed”</literal> signal</title>
<indexterm zone="GtkSelectionModel-selection-changed"><primary>GtkSelectionModel::selection-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link> *model,
               <link linkend="guint"><type>guint</type></link>              position,
               <link linkend="guint"><type>guint</type></link>              n_items,
               <link linkend="gpointer"><type>gpointer</type></link>           user_data)</programlisting>
<para>Emitted when the selection state of some of the items in <parameter>model</parameter>
 changes.</para>
<para>Note that this signal does not specify the new selection state of the items,
they need to be queried manually.

It is also not necessary for a model to change the selection state of any of
the items in the selection model, though it would be rather useless to emit
such a signal.</para>
<refsect3 id="GtkSelectionModel-selection-changed.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>model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkSelectionModel"><type>GtkSelectionModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>The first item that may have changed</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_items</para></entry>
<entry role="parameter_description"><para>number of items with changes</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkSelectionModel.see-also">
<title>See Also</title>
<para><link linkend="GListModel"><type>GListModel</type></link>, <link linkend="GtkSingleSelection"><type>GtkSingleSelection</type></link></para>

</refsect1>

</refentry>
