<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtktreeselection">
  <refnamediv>
    <refname>gtk.TreeSelection</refname>
    <refpurpose>the selection object for <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link></refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TreeSelection</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkobject">gtk.Object</link></classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--set-mode">set_mode</link></methodname>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-mode">get_mode</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--set-select-function">set_select_function</link></methodname>
	<methodparam><parameter
		       role="keyword">func</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">data</parameter>
	  <initializer>None</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">full</parameter>
	  <initializer>False</initializer></methodparam>
      </methodsynopsis>

<!-- NOT IMPLEMENTED
<methodsynopsis language="python">
    <methodname><link linkend="method-gtktreeselection- -get-user-data">get_user_data</link></methodname>
    <methodparam></methodparam>  </methodsynopsis>
END NOT IMPLEMENTED -->

      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-tree-view">get_tree_view</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-selected">get_selected</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--get-selected-rows">get_selected_rows</link></methodname>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--count-selected-rows">count_selected_rows</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--selected-foreach">selected_foreach</link></methodname>
	<methodparam><parameter>func</parameter></methodparam>
	<methodparam><parameter>data</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-path">select_path</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-path">unselect_path</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-iter">select_iter</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-iter">unselect_iter</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--path-is-selected">path_is_selected</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--iter-is-selected">iter_is_selected</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-all">select_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-all">unselect_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-range">select_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start_path</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">end_path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--unselect-range">unselect_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start_path</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">end_path</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtktreeselection">gtk.TreeSelection</link>
</synopsis>

  </refsect1>

  <refsect1 id="signal-prototypes-gtktreeselection">
    <title>gtk.TreeSelection Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>

    <variablelist>
      <varlistentry>
        <term>"<link
linkend="signal-gtktreeselection--changed">changed</link>"</term>
        <listitem>
          <methodsynopsis
	    language="python"><methodname>callback</methodname>
            <methodparam><parameter>treeselection</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is a helper object to manage the selection for a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget. The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is automatically created when a new <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget is created, and cannot exist independent of this widget. The primary
reason the <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object exists is for cleanliness of code and API. That is, there is no
conceptual reason all these functions could not be methods on the <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget instead of a separate function. The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is retrieved from a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link> by
calling the <link
linkend="method-gtktreeview--get-selection"><methodname>gtk.TreeView.get_selection</methodname>()</link>
method. It can be manipulated to check the selection status of the tree, as
well as select and deselect individual rows. Selection is done completely on
the view side. As a result, multiple views of the same model can have
completely different selections. Additionally, you cannot change the
selection of a row on the model that is not currently displayed by the view
without expanding its parents first.</para>

    <para>One of the important things to remember when monitoring the
selection of a view is that the "changed" signal is mostly a hint. That is,
it may only emit one signal when a range of rows is selected. Additionally,
it may on occasion emit a "changed" signal when nothing has happened (mostly
as a result of programmers calling the <link
linkend="method-gtktreeselection--select-path"><methodname>select_path</methodname>()</link>
or <link
linkend="method-gtktreeselection--select-iter"><methodname>select_iter</methodname>()</link>
methods on an already selected row).</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktreeselection--set-mode">
      <title>gtk.TreeSelection.set_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_mode</methodname>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_mode</methodname>() method sets the
selection mode of the treeselection to the mode specified by
<parameter>type</parameter>. The value of <parameter>type</parameter> must
be one of: <literal>gtk.SELECTION_NONE</literal>,
<literal>gtk.SELECTION_SINGLE</literal>,
<literal>gtk.SELECTION_BROWSE</literal> or
<literal>gtk.SELECTION_MULTIPLE</literal>. See the <xref
linkend="gtk-selection-mode-constants"
endterm="gtk-selection-mode-constants-title"></xref> description for more
detail.</para>

      <para>If the previous type was
<literal>gtk.SELECTION_MULTIPLE</literal>, then the anchor is kept selected,
if it was previously selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-mode">
      <title>gtk.TreeSelection.get_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_mode</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current selection mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_mode</methodname>() method returns the
selection mode for treeselection. See the <link
linkend="method-gtktreeselection--set-mode"><methodname>set_mode</methodname>()</link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--set-select-function">
      <title>gtk.TreeSelection.set_select_function</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_select_function</methodname>
	  <methodparam><parameter
		       role="keyword">func</parameter></methodparam>
	  <methodparam><parameter
		       role="keyword">data</parameter><initializer>None</initializer></methodparam>
	  <methodparam><parameter
		       role="keyword">full</parameter><initializer>False</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>func</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection function.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>data</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection function's
data.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>full</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>
	  <parameter>func</parameter> will be passed a full set of
	  args</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_selection_function</methodname>() method
sets the selection function to <parameter>func</parameter> (a function or
method). If the selection function is set, it is called before any node is
selected or unselected, giving some control over which nodes are selected.
The selection function should return <literal>True</literal> if the state of
the node may be toggled, and <literal>False</literal> if the state of the
node should be left unchanged. The signature of the selection function
callback is:</para>

<programlisting>
  <methodsynopsis language="python">
    <methodname>selectfunction</methodname>
    <methodparam><parameter>info</parameter></methodparam>
  </methodsynopsis>
  <methodsynopsis language="python">
    <methodname>selectmethod</methodname>
    <methodparam><parameter>self</parameter></methodparam>
    <methodparam><parameter>info</parameter></methodparam>
  </methodsynopsis>
</programlisting>

<para>where <parameter>info</parameter> is a tuple containing a path or a
path and <parameter>data</parameter> if <parameter>data</parameter> was
passed to the <link
linkend="method-gtktreeselection--set-select-function"><methodname>set_select_function</methodname>()</link>
method.</para>

<para>In PyGTK 2.10 and above if the additional optional parameter
<parameter>full</parameter> is <literal>True</literal> the signature of
<parameter>func</parameter> should be:</para>

<programlisting>
<methodsynopsis language="python">
	  <methodname>selectfunction</methodname>
	  <methodparam><parameter>selection</parameter></methodparam>
	  <methodparam><parameter>model</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>path_currently_selected</parameter></methodparam>
	  <methodparam><parameter>user_data</parameter></methodparam>
	</methodsynopsis>
<methodsynopsis language="python">
	  <methodname>selectmethod</methodname>
	  <methodparam><parameter>self</parameter></methodparam>
	  <methodparam><parameter>selection</parameter></methodparam>
	  <methodparam><parameter>model</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>is_selected</parameter></methodparam>
	  <methodparam><parameter>user_data</parameter></methodparam>
	</methodsynopsis>
</programlisting>

      <para>where <parameter>selection</parameter> is the <link
      linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>,
      <parameter>model</parameter> is the <link
      linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
      used by the <link
      linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
      associated with selection, <parameter>path</parameter> is the path of
      the selected row, <parameter>is_selected</parameter> is
      <literal>True</literal> if the row is currently selected and
      <parameter>user_data</parameter> is <parameter>data</parameter> if any
      (may not be present if <parameter>data</parameter> was
      <literal>None</literal>). If <parameter>func</parameter> is a method
      then <parameter>self</parameter> is the object that the method is
      called upon.</para>

    </refsect2>

<!-- NOT IMPLEMENTED
    <refsect2 id="method-gtktreeselection- -get-user-data">
    <title>gtk.TreeSelection.get_user_data</title>

<programlisting><methodsynopsis language="python">
    <methodname>get_user_data</methodname>
    <methodparam></methodparam>
  </methodsynopsis></programlisting>
  <variablelist>
    <varlistentry>
      <term><emphasis>Returns</emphasis>&nbsp;:</term>
      <listitem><simpara>the user data.</simpara></listitem>
    </varlistentry>
  </variablelist>

      <para>Returns the user data for the selection function.
</para>  </refsect2>
END NOT IMPLEMENTED -->

    <refsect2 id="method-gtktreeselection--get-tree-view">
      <title>gtk.TreeSelection.get_tree_view</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_tree_view</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_tree_iter</methodname>() method returns the
tree view associated with the treeselection.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-selected">
      <title>gtk.TreeSelection.get_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_selected</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing a reference to the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link> and
a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing to the currently selected node.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_selected</methodname>() method returns a
2-tuple containing the treemodel and a treeiter pointing to the selected node
in the treemodel if the treeselection is set to
<literal>gtk.SELECTION_SINGLE</literal> or
<literal>gtk.SELECTION_BROWSE</literal>. The returned <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> will
be <literal>None</literal> if there is no row selected. This method will not
work if you use <parameter>selection</parameter> is
<literal>gtk.SELECTION_MULTIPLE</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-selected-rows">
      <title>gtk.TreeSelection.get_selected_rows</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_selected_rows</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing the tree model and a list
	  of the tree paths of all selected rows.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_selected_rows</methodname>() method returns
a 2-tuple containing a <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link> and
a list of the tree paths of all selected rows. Additionally, if you are
planning on modifying the tree model after calling this method, you may want
to convert the returned list into a list of <link
linkend="class-gtktreerowreference"><classname>gtk.TreeRowReference</classname></link>
objects.  To do this, you can use the <link
linkend="constructor-gtktreerowreference">gtk.TreeRowReference</link>()
constructor.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--count-selected-rows">
      <title>gtk.TreeSelection.count_selected_rows</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>count_selected_rows</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The number of rows selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>count_selected_rows</methodname>() method
returns the number of rows that have been selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--selected-foreach">
      <title>gtk.TreeSelection.selected_foreach</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>selected_foreach</methodname>
	  <methodparam><parameter>func</parameter></methodparam>
	  <methodparam><parameter>data</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>func</parameter>&nbsp;:</term>
	  <listitem><simpara>the function or method to call for each
selected node.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>data</parameter>&nbsp;:</term>
	  <listitem><simpara>the user data to pass to
<parameter>func</parameter>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>selected_foreach</methodname>() method calls the
function or method specified by <parameter>func</parameter> for each
selected node passing the user data specified by
<parameter>data</parameter>. The signature of <parameter>func</parameter>
is:</para>

      <programlisting>
<methodsynopsis language="python">
	  <methodname>foreachfunction</methodname>
	  <methodparam><parameter>treemodel</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis>
<methodsynopsis language="python">
	  <methodname>foreachmethod</methodname>
	  <methodparam><parameter>self</parameter></methodparam>
	  <methodparam><parameter>treemodel</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis>
</programlisting>

      <para>where <parameter>treemodel</parameter> is the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
being viewed, <parameter>path</parameter> is the path of the selected row,
<parameter>iter</parameter> is a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing to the selected row and <parameter>...</parameter> is the user data
if any (may not be present if <parameter>data</parameter> was
<literal>None</literal>). If <parameter>func</parameter> is a method then
<parameter>self</parameter> is the object that the method is called
upon.</para>

      <note>
        <para>You cannot modify the tree or selection in the callback
function.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-path">
      <title>gtk.TreeSelection.select_path</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_path</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the tree path to be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_path</methodname>() method selects the
row at <parameter>path</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-path">
      <title>gtk.TreeSelection.unselect_path</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_path</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the tree path to be
unselected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>unselect_path</methodname>() method unselects
the row at <parameter>path</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-iter">
      <title>gtk.TreeSelection.select_iter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_iter</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> to be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_iter</methodname>() method selects the
row pointed to by the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
specified by <parameter>iter</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-iter">
      <title>gtk.TreeSelection.unselect_iter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_iter</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> to be
unselected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>unselect_iter</methodname>() method unselects
the row pointed to by the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
specified by <parameter>iter</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--path-is-selected">
      <title>gtk.TreeSelection.path_is_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>path_is_selected</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>A tree path to check if
selected.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if
<parameter>path</parameter> is selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>path_is_selected</methodname>() method returns
<literal>True</literal> if the row pointed to by <parameter>path</parameter>
is currently selected.  If <parameter>path</parameter> does not point to a
valid location, <literal>False</literal> is returned.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--iter-is-selected">
      <title>gtk.TreeSelection.iter_is_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>iter_is_selected</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal>, if the row pointed to
by <parameter>iter</parameter> is selected</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>iter_is_selected</methodname>() method returns
<literal>True</literal> if the row pointed to by <parameter>iter</parameter>
is currently selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-all">
      <title>gtk.TreeSelection.select_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_all</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <para>The <methodname>select_all</methodname>() method selects all the
nodes.  The treeselection is must be set to
<literal>gtk.SELECTION_MULTIPLE</literal> mode.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-all">
      <title>gtk.TreeSelection.unselect_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_all</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <para>The <methodname>unselect_all</methodname>() method unselects all
the nodes.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-range">
      <title>gtk.TreeSelection.select_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_range</methodname>
	  <methodparam><parameter
			 role="keyword">start_path</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">end_path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">start_path</parameter>&nbsp;:</term>
	  <listitem><simpara>the initial node path of the
range.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">end_path</parameter>&nbsp;:</term>
	  <listitem><simpara>the final node path of the
range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_range</methodname>() method selects a
range of nodes specified by the tree paths
<parameter>start_path</parameter> and <parameter>end_path</parameter>
inclusive.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-range">
      <title>gtk.TreeSelection.unselect_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_range</methodname>
	  <methodparam><parameter>start_path</parameter></methodparam>
	  <methodparam><parameter>end_path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>start_path</parameter>&nbsp;:</term>
	  <listitem><simpara>The initial node of the
	  range.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>end_path</parameter>&nbsp;:</term>
	  <listitem><simpara>The final node of the
	  range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>unselect_range</methodname>() method unselects
the range of nodes specified by the tree paths
<parameter>start_path</parameter> and <parameter>end_path</parameter>
inclusive.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtktreeselection--changed">
      <title>The "changed" gtk.TreeSelection Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>treeselection</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>treeselection</parameter>&nbsp;:</term>
	  <listitem><simpara>the treeselection that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The "changed" signal is emitted when the selection has
changed.</para>

    </refsect2>

  </refsect1>

</refentry>
