diff options
author | John Finlay <finlay@src.gnome.org> | 2004-05-20 04:17:55 +0000 |
---|---|---|
committer | John Finlay <finlay@src.gnome.org> | 2004-05-20 04:17:55 +0000 |
commit | a3a82eedc3d5db5a765e66f9396905af14ac335f (patch) | |
tree | fc4a4b7b12ab5fdd0cff17ad629ab4e5e15dca59 | |
parent | e35993d7711d80a6e728885e1342c54ba4758c33 (diff) | |
download | pygtk-a3a82eedc3d5db5a765e66f9396905af14ac335f.tar.gz |
pygtk-pygtktreemodelrow.xml Add.
* pygtk-pygtktreemodelrow.xml Add.
-rw-r--r-- | docs/reference/pygtk-pygtktreemodelrow.xml | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/docs/reference/pygtk-pygtktreemodelrow.xml b/docs/reference/pygtk-pygtktreemodelrow.xml new file mode 100644 index 00000000..b44b54b7 --- /dev/null +++ b/docs/reference/pygtk-pygtktreemodelrow.xml @@ -0,0 +1,189 @@ +<?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> :</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> |