<?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-pygtktreemodelrow">
  <refnamediv>
    <refname>gtk.TreeModelRow</refname>
    <refpurpose>an object representing a row in a <link 
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link></refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TreeModelRow</classname></ooclass>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtktreemodelrow--iterchildren">iterchildren</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

</refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GBoxed</link>
    +-- <link linkend="class-gtkwidget">gtk.TreeModelRow</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"next"</entry>
              <entry>Read</entry>

              <entry>The next <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
or <literal>None</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"parent"</entry>
	      <entry>Read</entry>

	      <entry>The parent <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
 of this row or <literal>None</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"model"</entry>
	      <entry>Read</entry>

	      <entry>The <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
that the row is part of.</entry>
	    </row>

	    <row valign="top">
	      <entry>"path"</entry>
	      <entry>Read</entry>
	      <entry>The tree path of the row</entry>
	    </row>

	    <row valign="top">
	      <entry>"iter"</entry>
              <entry>Read</entry>

              <entry>A <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing at the row.</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
object represents a row in a <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>. A
<link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
is created by taking the mapping of a <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>. For
example:</para>

    <programlisting>
  treemodelrow = liststore[0]
  treemodelrow = liststore[(0,)]
  treemodelrow = liststore['0']
</programlisting>

    <para>all create a <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
for the first row in <parameter>liststore</parameter>. The <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
implements some of the Python sequence protocol that makes the row behave
like a sequence of objects. Specifically a tree model row has the capability
of:</para>

    <itemizedlist>
      <listitem>
        <simpara>getting and setting column values,</simpara>
      </listitem>
      <listitem>
        <simpara>returning a tuple or list containing the column values,
and</simpara>
      </listitem>
      <listitem>
        <simpara>getting the number of values in the row i.e. the number of
columns</simpara>
      </listitem>
   </itemizedlist>

    <para>For example to get and set the value in the second column of a
row, you could do the following:</para>

    <programlisting>
  value = treemodelrow[1]
  treemodelrow[1] = value
</programlisting>

    <para>You can use the Python <function>len</function>() function to get
the number of columns in the row and you can retrieve all the column values
as a list (tuple) using the Python <function>list</function>()
(<function>tuple</function>()) function.</para>

    <para>The <link
linkend="class-pygtktreemodelrow"><classname>gtk.TreeModelRow</classname></link>
supports one method: the <link
linkend="method-gtktreemodelrow--iterchildren"><methodname>iterchildren</methodname>()</link>
method that returns a <link
linkend="class-pygtktreemodelrowiter"><classname>gtk.TreeModelRowIter</classname></link>
for iterating over the children of the row.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktreemodelrow--iterchildren">
      <title>gtk.TreeModelRow.iterchildren</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>iterchildren</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-pygtktreemodelrowiter"><classname>gtk.TreeModelRowIter</classname></link>
	  for the row's children or
	  <literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>iterchildren</methodname>() method returns a
<link
linkend="class-pygtktreemodelrowiter"><classname>gtk.TreeModelRowIter</classname></link>
for iterating over the children of the row or <literal>None</literal> if the
row has no children.</para>

    </refsect2>

  </refsect1>

</refentry>
