<?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-gtktextiter">
  <refnamediv>
    <refname>gtk.TextIter</refname>
    <refpurpose>an object pointing at a location in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link></refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TextIter</classname></ooclass>
      <ooclass><classname>gobject.GBoxed</classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-buffer">get_buffer</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--copy">copy</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-offset">get_offset</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-line">get_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-line-offset">get_line_offset</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-line-index">get_line_index</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-visible-line-offset">get_visible_line_offset</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-visible-line-index">get_visible_line_index</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-char">get_char</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-slice">get_slice</link></methodname>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-text">get_text</link></methodname>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-visible-slice">get_visible_slice</link></methodname>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-visible-text">get_visible_text</link></methodname>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-pixbuf">get_pixbuf</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-marks">get_marks</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-child-anchor">get_child_anchor</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-toggled-tags">get_toggled_tags</link></methodname>
	<methodparam><parameter
		       role="keyword">toggled_on</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--begins-tag">begins_tag</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--ends-tag">ends_tag</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--toggles-tag">toggles_tag</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--has-tag">has_tag</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-tags">get_tags</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--editable">editable</link></methodname>
	<methodparam><parameter
		       role="keyword">default_setting</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--can-insert">can_insert</link></methodname>
	<methodparam><parameter
		       role="keyword">default_editability</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--starts-word">starts_word</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--ends-word">ends_word</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--inside-word">inside_word</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--starts-sentence">starts_sentence</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--ends-sentence">ends_sentence</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--inside-sentence">inside_sentence</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--starts-line">starts_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--ends-line">ends_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--is-cursor-position">is_cursor_position</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-chars-in-line">get_chars_in_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-bytes-in-line">get_bytes_in_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-attributes">get_attributes</link></methodname>
	<methodparam><parameter
		       role="keyword">values</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--get-language">get_language</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--is-end">is_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--is-start">is_start</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-char">forward_char</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-char">backward_char</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-chars">forward_chars</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-chars">backward_chars</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-line">forward_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-line">backward_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-lines">forward_lines</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-lines">backward_lines</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-word-ends">forward_word_ends</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-word-starts">backward_word_starts</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-word-end">forward_word_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-word-start">backward_word_start</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-cursor-position">forward_cursor_position</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-cursor-position">backward_cursor_position</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-cursor-positions">forward_cursor_positions</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-cursor-positions">backward_cursor_positions</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-sentence-start">backward_sentence_start</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-sentence-end">forward_sentence_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-sentence-starts">backward_sentence_starts</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-sentence-ends">forward_sentence_ends</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--forward-visible-word-ends">forward_visible_word_ends</link></methodname>
	<methodparam><parameter role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--backward-visible-word-starts">backward_visible_word_starts</link></methodname>
	<methodparam><parameter role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--forward-visible-word-end">forward_visible_word_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--backward-visible-word-start">backward_visible_word_start</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-visible-cursor-position">forward_visible_cursor_position</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-visible-cursor-position">backward_visible_cursor_position</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-visible-cursor-positions">forward_visible_cursor_positions</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-visible-cursor-positions">backward_visible_cursor_positions</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-visible-line">forward_visible_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-visible-line">backward_visible_line</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-visible-lines">forward_visible_lines</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-visible-lines">backward_visible_lines</link></methodname>
	<methodparam><parameter
		       role="keyword">count</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-offset">set_offset</link></methodname>
	<methodparam><parameter
		       role="keyword">char_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-line">set_line</link></methodname>
	<methodparam><parameter
		       role="keyword">line_number</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-line-offset">set_line_offset</link></methodname>
	<methodparam><parameter
		       role="keyword">char_on_line</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-line-index">set_line_index</link></methodname>
	<methodparam><parameter
		       role="keyword">byte_on_line</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-to-end">forward_to_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-to-line-end">forward_to_line_end</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-visible-line-offset">set_visible_line_offset</link></methodname>
	<methodparam><parameter
		       role="keyword">char_on_line</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--set-visible-line-index">set_visible_line_index</link></methodname>
	<methodparam><parameter
		       role="keyword">byte_on_line</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--forward-to-tag-toggle">forward_to_tag_toggle</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-to-tag-toggle">backward_to_tag_toggle</link></methodname>
	<methodparam><parameter role="keyword">tag</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--forward-find-char">forward_find_char</link></methodname>
	<methodparam><parameter role="keyword">pred</parameter></methodparam>
	<methodparam><parameter role="keyword">user_data</parameter></methodparam>
	<methodparam><parameter role="keyword">limit</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--backward-find-char">backward_find_char</link></methodname>
	<methodparam><parameter role="keyword">pred</parameter></methodparam>
	<methodparam><parameter role="keyword">user_data</parameter></methodparam>
	<methodparam><parameter role="keyword">limit</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktextiter--forward-search">forward_search</link></methodname>
	<methodparam><parameter role="keyword">str</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">flags</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">limit</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--backward-search">backward_search</link></methodname>
	<methodparam><parameter role="keyword">str</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">flags</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">limit</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--equal">equal</link></methodname>
	<methodparam><parameter role="keyword">rhs</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--compare">compare</link></methodname>
	<methodparam><parameter role="keyword">rhs</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--in-range">in_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start</parameter></methodparam>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktextiter--order">order</link></methodname>
	<methodparam><parameter
		       role="keyword">second</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
points to a position between two characters in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>.
A <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link> is
usually created using a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
method and are invalidated when the number of characters in the <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
changes (with some exceptions when inserting or deleting) including
inserting or deleting pixbufs or child anchors. There are a huge number of
<link linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
methods mostly dealing with moving the textiter location in the textbuffer,
checking the location or retrieving text or objects at a location.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-gtktextiter--get-buffer">
      <title>gtk.TextIter.get_buffer</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_buffer</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the textbuffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_buffer</methodname>() method returns the
<link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
object this iterator is associated with.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--copy">
      <title>gtk.TextIter.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a copy of the textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method creates a copy of the
textiter.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-offset">
      <title>gtk.TextIter.get_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_offset</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a character offset</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_offset</methodname>() method returns the
character offset of the textiter. Each character in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
has an offset, starting with 0 for the first character in the textbuffer.
Use <link
linkend="method-gtktextbuffer--get-iter-at-offset"><methodname>gtk.TextBuffer.get_iter_at_offset</methodname>()</link> 
to convert an offset back into a textiter.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-line">
      <title>gtk.TextIter.get_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a line number</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_line</methodname>() method returns the line
number containing the textiter. Lines in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
are numbered beginning with 0 for the first line.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-line-offset">
      <title>gtk.TextIter.get_line_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_line_offset</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the offset from the start of the
line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_line_offset</methodname>() method returns
the character offset of the textiter location, counting from the start of
the line containing the textiter location. The first character on the line
has offset 0.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-line-index">
      <title>gtk.TextIter.get_line_index</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_line_index</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of bytes from the start of the
line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_line_offset</methodname>() method returns
the byte index of the textiter location, counting from the start of the line
containing the textiter location. Remember that <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
encodes text in UTF-8, and that characters can require a variable number of
bytes to represent.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-visible-line-offset">
      <title>gtk.TextIter.get_visible_line_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visible_line_offset</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the offset in visible characters from the start
of the line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_visible_line_offset</methodname>() method
returns the offset in characters of the textiter location from the start of
the line containing the textiter location, not counting characters that are
invisible due to tags with the "invisible" attribute set.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-visible-line-index">
      <title>gtk.TextIter.get_visible_line_index</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visible_line_index</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a byte index from the start of the
line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_visible_line_index</methodname>() method
returns the byte index of the textiter location from the start of the line,
not counting bytes that are invisible due to tags with the "invisible"
attribute set.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-char">
      <title>gtk.TextIter.get_char</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_char</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a Unicode character, or \0 character if the textiter is
not dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_char</methodname>() method returns the
Unicode character at this textiter location. If the textiter points at a
non-character element, such as an image embedded in the buffer, the Unicode
"unknown" character 0xFFFC is returned. If invoked on the end textiter, the null
character is returned; \0 is not a valid Unicode character. So you can write a loop
which ends when the <link
linkend="method-gtktextiter--get-char"><methodname>get_char</methodname>()</link> 
method returns \0.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-slice">
      <title>gtk.TextIter.get_slice</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_slice</methodname>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>the textiter at the end of a
range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a slice of text from the
textbuffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_slice</methodname>() method returns the text
in the range between the locations specified by the textiter and
<parameter>end</parameter>. A "slice" is an array of characters encoded in
UTF-8 format, including the Unicode "unknown" character 0xFFFC for iterable
non-character elements in the textbuffer, such as images.  Because images
are encoded in the slice, byte and character offsets in the returned array
will correspond to byte offsets in the textbuffer. Note that 0xFFFC can
occur in normal text as well, so it is not a reliable indicator that a
pixbuf or widget is in the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-text">
      <title>gtk.TextIter.get_text</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_text</methodname>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>textiter at end of a range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>array of characters from the
buffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_text</methodname>() method returns the text
in the range between the locations specified by the textiter and
<parameter>end</parameter>. If the range contains non-text elements such as
images, the character and byte offsets in the returned string will not
correspond to character and byte offsets in the textbuffer. If you want the
offsets to correspond, use the <link
linkend="method-gtktextiter--get-slice"><methodname>get_slice</methodname>()</link> 
method.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-visible-slice">
      <title>gtk.TextIter.get_visible_slice</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visible_slice</methodname>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>textiter at end of range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a slice of visible text from the
textbuffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_visible_slice</methodname>() method is
similar to the <link
linkend="method-gtktextiter--get-slice"><methodname>get_slice</methodname>()</link> 
method, but invisible text is excluded. Invisible text is text with the
"invisible" attribute set on it.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-visible-text">
      <title>gtk.TextIter.get_visible_text</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_visible_text</methodname>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>textiter at end of range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a string containing visible text from the
textbuffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_visible_text</methodname>() method is
similar to the <link
linkend="method-gtktextiter--get-text"><methodname>get_text</methodname>()</link>, 
but invisible text is excluded. Invisible text is text with the "invisible"
attribute set on it.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-pixbuf">
      <title>gtk.TextIter.get_pixbuf</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_pixbuf</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a pixbuf or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_pixbuf</methodname>() method returns the
<link linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
object at the textiter location, if any; otherwise, <literal>None</literal>
is returned.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-marks">
      <title>gtk.TextIter.get_marks</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_marks</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of <link
linkend="class-gtktextmark"><classname>gtk.TextMark</classname></link>
objects</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_marks</methodname>() method returns a list
of all <link
linkend="class-gtktextmark"><classname>gtk.TextMark</classname></link>
objects at the textiter location. Because marks don't take up any "space" in
the buffer, multiple marks can exist in the same location. The returned list
is not in any meaningful order.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-child-anchor">
      <title>gtk.TextIter.get_child_anchor</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_child_anchor</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a child anchor or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_child_anchor</methodname>() method returns
the <link
linkend="class-gtktextchildanchor"><classname>gtk.TextChildAnchor</classname></link> 
at the textiter location, if any; otherwise, <literal>None</literal> is
returned.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-toggled-tags">
      <title>gtk.TextIter.get_toggled_tags</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_toggled_tags</methodname>
	  <methodparam><parameter
			 role="keyword">toggled_on</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">toggled_on</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> get toggled-on tags;
otherwise get toggle-off tags</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of tags toggled at this
point</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_toggled_tags</methodname>() method returns a
list of <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> objects
that are toggled on or off at this point.  If
<parameter>toggled_on</parameter> is <literal>True</literal>, the list
contains tags that are toggled on. If a tag is toggled on at the textiter
location, some non-empty range of characters following the textiter has that
tag applied to it.  If a tag is toggled off, then some non-empty range
following the textiter location does not have the tag applied to it.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--begins-tag">
      <title>gtk.TextIter.begins_tag</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>begins_tag</methodname>
	  <methodparam><parameter role="keyword">tag</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter is the
start of a range tagged with <parameter>tag</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>begins_tag</methodname>() method returns
<literal>True</literal> if <parameter>tag</parameter> is toggled on at
exactly this point. If <parameter>tag</parameter> is
<literal>None</literal>, this method returns <literal>True</literal> if any
tag is toggled on at this point. Note that the<methodname>
begins_tag</methodname>() method returns <literal>True</literal> only if the
textiter location is the <emphasis>start</emphasis> of the tagged range; the
<link
linkend="method-gtktextiter--has-tag"><methodname>has_tag</methodname>()</link> 
indicates if a textiter location is <emphasis>within</emphasis> a tagged
range.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--ends-tag">
      <title>gtk.TextIter.ends_tag</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>ends_tag</methodname>
	  <methodparam><parameter role="keyword">tag</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter is the
end of a range tagged with <parameter>tag</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>ends_tag</methodname>() method returns
<literal>True</literal> if <parameter>tag</parameter> is toggled off at the
location the textiter points to. If <parameter>tag</parameter> is
<literal>None</literal>, this method returns <literal>True</literal> if any
tag is toggled off at this point. Note that the
<methodname>ends_tag</methodname>() returns <literal>True</literal> only if
the textiter location is the <emphasis>end</emphasis> of the tagged range;
the <link
linkend="method-gtktextiter--has-tag"><methodname>has_tag</methodname>()</link> 
indicates if a textiter location is <emphasis>within</emphasis> a tagged
range.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--toggles-tag">
      <title>gtk.TextIter.toggles_tag</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>toggles_tag</methodname>
	  <methodparam><parameter
			 role="keyword">tag</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if
<parameter>tag</parameter> is toggled on or off at the textiter
location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>toggles_tag</methodname>() method returns
<literal>True</literal> if a range of text with <parameter>tag</parameter>
applied to it begins <emphasis>or</emphasis> ends at the textiter location.
If <parameter>tag</parameter> is <literal>None</literal> this method returns
<literal>True</literal> if any tag begins or ends at the textiter
location.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--has-tag">
      <title>gtk.TextIter.has_tag</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>has_tag</methodname>
	  <methodparam><parameter
			 role="keyword">tag</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is tagged with <parameter>tag</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>has_tag</methodname>() method returns
<literal>True</literal> if the textiter location is within a range of text
tagged with <parameter>tag</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-tags">
      <title>gtk.TextIter.get_tags</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_tags</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>
objects</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_tags</methodname>() method returns a list of
tags that apply to the textiter location, in ascending order of priority
(highest-priority tags are last).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--editable">
      <title>gtk.TextIter.editable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>editable</methodname>
	  <methodparam><parameter
			 role="keyword">default_setting</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">default_setting</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the text is editable
by default</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is inside an editable range or text</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>editable</methodname>() method returns
<literal>True</literal> if the character at the textiter location is within
an editable range of text.  Non-editable text is "locked" and can't be
changed by the user via a <link
linkend="class-gtktextview"><classname>gtk.TextView</classname></link>. This
method is a convenience wrapper around the <link
linkend="method-gtktextiter--get-attributes"><methodname>get_attributes</methodname>()</link> 
method. If no tags applied to this text location affect editability, the
value of <parameter>default_setting</parameter> will be returned.</para>

      <para>Do not use this method to determine if text can be inserted at
the textiter location. For insertion you don't want to know if the char at
the textiter location is inside an editable range of text, you want to know
whether a new character inserted at the textiter location would be inside an
editable range of text. Use the <link
linkend="method-gtktextiter--can-insert"><methodname>can_insert</methodname>()</link> 
method to determine if text can be inserted.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--can-insert">
      <title>gtk.TextIter.can_insert</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>can_insert</methodname>
	  <methodparam><parameter
			 role="keyword">default_editability</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">default_editability</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the text is editable
by default</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if text inserted at
<parameter>iter</parameter> would be editable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>can_insert</methodname>() method considers the
default editability of the buffer, and the tags that affect editability, to
determine if text inserted at the textiter location would be editable. If
so, the user should be allowed to insert text at the textiter location. The
<link
linkend="method-gtktextbuffer--insert-interactive"><methodname>gtk.TextBuffer.insert_interactive</methodname>()</link> 
uses this function to determine if insertions are allowed at a given
position.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--starts-word">
      <title>gtk.TextIter.starts_word</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>starts_word</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the start of a word</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>starts_word</methodname>() method returns
<literal>True</literal> if the textiter location begins a natural-language
word.  Word breaks are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango word break
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--ends-word">
      <title>gtk.TextIter.ends_word</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>ends_word</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the end of a word</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>ends_word</methodname>() method returns
<literal>True</literal> if the textiter location ends a natural-language
word.  Word breaks are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango word break
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--inside-word">
      <title>gtk.TextIter.inside_word</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>inside_word</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is inside a word</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>inside_word</methodname>() method returns
<literal>True</literal> if the textiter location is inside a
natural-language word (as opposed to say inside some whitespace). Word
breaks are determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango word break
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--starts-sentence">
      <title>gtk.TextIter.starts_sentence</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>starts_sentence</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the start of a sentence.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>starts_sentence</methodname>() method returns
<literal>True</literal> if the textiter location begins a sentence.
Sentence boundaries are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango text boundary
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--ends-sentence">
      <title>gtk.TextIter.ends_sentence</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>ends_sentence</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the end of a sentence.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>ends_sentence</methodname>() method returns
<literal>True</literal> if the textiter location ends a sentence.  Sentence
boundaries are determined by Pango and should be correct for nearly any
language (if not, the correct fix would be to the Pango text boundary
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--inside-sentence">
      <title>gtk.TextIter.inside_sentence</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>inside_sentence</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is inside a sentence.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>inside_sentence</methodname>() method returns
<literal>True</literal> if the textiter location is inside a sentence (as
opposed to in between two sentences, e.g. after a period and before the
first letter of the next sentence).  Sentence boundaries are determined by
Pango and should be correct for nearly any language (if not, the correct fix
would be to the Pango text boundary algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--starts-line">
      <title>gtk.TextIter.starts_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>starts_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location begins a line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>starts_line</methodname>() method returns
<literal>True</literal> if the textiter location begins a paragraph, i.e. if
the <link
linkend="method-gtktextiter--get-line-offset"><methodname>.get_line_offset</methodname>()</link> 
method would return 0.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--ends-line">
      <title>gtk.TextIter.ends_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>ends_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the end of a line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>ends_line</methodname>() method returns
<literal>True</literal> if the textiter location points to the start of the
paragraph delimiter characters for a line (delimiters will be either a
newline, a carriage return, a carriage return followed by a newline, or a
Unicode paragraph separator character). Note that an textiter pointing to
the \n of a \r\n pair will not be counted as the end of a line, the line
ends before the \r. The end textiter is considered to be at the end of a
line, even though there are no paragraph delimiter chars there.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--is-cursor-position">
      <title>gtk.TextIter.is_cursor_position</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>is_cursor_position</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the cursor can be
placed at the textiter location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>is_cursor_position</methodname>() method returns
<literal>True</literal> if the cursor can be placed at the textiter
location. See the <link
linkend="method-gtktextiter--forward-cursor-position"><methodname>forward_cursor_position</methodname>()</link> 
method for details on what a cursor position is.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-chars-in-line">
      <title>gtk.TextIter.get_chars_in_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_chars_in_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of characters in the
line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_chars_in_line</methodname>() method returns
the number of characters in the line containing the textiter location,
including the paragraph delimiters.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-bytes-in-line">
      <title>gtk.TextIter.get_bytes_in_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_bytes_in_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of bytes in the
line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_bytes_in_line</methodname>() method returns
the number of bytes in the line containing the textiter location, including
the paragraph delimiters.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-attributes">
      <title>gtk.TextIter.get_attributes</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_attributes</methodname>
	  <methodparam><parameter
			 role="keyword">values</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">values</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object to be filled in</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if
<parameter>values</parameter> was modified</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_attributes</methodname>() method computes
the effect of any tags applied to the textiter location and applies those
attributes to the <link
linkend="class-gtktextattributes"><classname>gtk.TextAttributes</classname></link> 
object specified by <parameter>values</parameter> (which should be
initialized to the default settings you wish to use if no tags are in
effect). Typically the default attributes are obtained from the <link
linkend="method-gtktextview--get-default-attributes"><methodname>gtk.TextView.get_default_attributes</methodname>()</link> 
method. If any tags affected <parameter>values</parameter>, the method
returns <literal>True</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--get-language">
      <title>gtk.TextIter.get_language</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_language</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the pango language in effect at the textiter
location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_language</methodname>() method is a
convenience wrapper around the <link
linkend="method-gtktextiter--get-attributes"><methodname>get_attributes</methodname>()</link> 
method, that returns the language in effect at the textiter location. If no
tags affecting language apply to the textiter location, the return value is
identical to that of the <function>gtk.get_default_language()</function>
function.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--is-end">
      <title>gtk.TextIter.is_end</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>is_end</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter is the
end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>is_end</methodname>() method returns
<literal>True</literal> if the textiter is the end textiter, i.e. one past
the last dereferenceable textiter in the buffer. The
<methodname>is_end</methodname>() method is the most efficient way to check
whether an textiter is the end textiter.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--is-start">
      <title>gtk.TextIter.is_start</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>is_start</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is at the start of the textbuffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>is_start</methodname>() method returns
<literal>True</literal> if the textiter location is at the start of the
textbuffer, that is if the textiter location has a character offset of
0.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--forward-char">
      <title>gtk.TextIter.forward_char</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_char</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_char</methodname>() method moves the
textiter location forward by one character offset and returns
<literal>True</literal> if the textiter location moved and the new location
is dereferenceable. Note that images embedded in the buffer occupy 1
character slot, so the <methodname>forward_char</methodname>() method may
actually move onto an image instead of a character, if you have images in
your buffer.  If the textiter location is the end textiter or one character
before it, the textiter location will now point at the end textiter, and the
<methodname>forward_char</methodname>() method returns
<literal>False</literal>.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--backward-char">
      <title>gtk.TextIter.backward_char</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_char</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>True if the textiter location moved and is
not the start textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_char</methodname>() method moves the
textiter location backward by one character offset and returns
<literal>True</literal> if the textiter location moved. If the old textiter
location was the first in the buffer (character offset 0), the
<methodname>backward_char</methodname>() method returns
<literal>False</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-chars">
      <title>gtk.TextIter.forward_chars</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_chars</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of characters to move, may be
negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_chars</methodname>() method moves the
textiter location forward <parameter>count</parameter> characters if
possible. If the textiter location would move past the start or end of the
buffer, the location moves to the start or end of the textbuffer. The
<methodname>forward_chars</methodname>() method returns
<literal>True</literal> if the new position of the resulting textiter
location is different from its original position, and is dereferenceable
(the last textiter in the buffer is not dereferenceable). If
<parameter>count</parameter> is 0, the function does nothing and returns
<literal>False</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-chars">
      <title>gtk.TextIter.backward_chars</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_chars</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of characters to move, may be
negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_chars</methodname>() method moves the
textiter location backward forward <parameter>count</parameter> characters,
if possible. If the textiter location would move past the start or end of
the buffer, the location moves to the start or end of the textbuffer.  The
<methodname>backward_chars</methodname>() method returns
<literal>True</literal> if the new position of the resulting textiter
location is different from its original position, and is dereferenceable
(the last textiter in the buffer is not dereferenceable). If
<parameter>count</parameter> is 0, the function does nothing and returns
<literal>False</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-line">
      <title>gtk.TextIter.forward_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location can be dereferenced</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_line</methodname>() method moves the
textiter location to the start of the next line and returns
<literal>True</literal> if the textiter location moved to a dereferenceable
position, and <literal>False</literal> if the textiter location moved to the
end of the buffer, or if the textiter location was originally at the end of
the buffer.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--backward-line">
      <title>gtk.TextIter.backward_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_line</methodname>() method moves the
textiter location to the start of the previous line and returns
<literal>True</literal> if the textiter location was moved. If the textiter
location was at the textbuffer start, this method returns
<literal>False</literal>. For example if the textiter location was already
on line 0, but not at the start of the line, the textiter location is
snapped to the start of the line and the method returns
<literal>True</literal>.</para>


    </refsect2>

    <refsect2 id="method-gtktextiter--forward-lines">
      <title>gtk.TextIter.forward_lines</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_lines</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of lines to move forward, may be
negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_lines</methodname>() method moves the
textiter location forward <parameter>count</parameter> lines, if possible.
If the textiter location would move past the start or end of the buffer, the
location moves to the start or end of the textbuffer.  The method
returns:</para>

      <itemizedlist>
	<listitem>
	  <simpara><literal>True</literal> if the textiter moved to a
dereferenceable position; or,</simpara>
	</listitem>
	<listitem>
	  <simpara><literal>False</literal> if the textiter location didn't
move, or moved onto the end textiter or if <parameter>count</parameter> was
0.</simpara>
	</listitem>
      </itemizedlist>

      <para>If <parameter>count</parameter> is negative, the textiter
location moves backward by <parameter>count</parameter> lines.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-lines">
      <title>gtk.TextIter.backward_lines</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_lines</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of lines to move backward, may be
negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved to a dereferenceable position</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_lines</methodname>() method moves the
textiter location backward by <parameter>count</parameter> lines, if
possible. If the textiter location would move past the start or end of the
buffer, the location moves to the start or end of the textbuffer.  The
method returns:</para>

      <itemizedlist>
	<listitem>
	  <simpara><literal>True</literal> if the textiter moved to a
dereferenceable position; or,</simpara>
	</listitem>
	<listitem>
	  <simpara><literal>False</literal> if the textiter location didn't
move, or moved onto the end textiter or if <parameter>count</parameter> was
0.</simpara>
	</listitem>
      </itemizedlist>

      <para>If <parameter>count</parameter> is negative, the textiter
location moves forward by <parameter>count</parameter> lines.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-word-ends">
      <title>gtk.TextIter.forward_word_ends</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_word_ends</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of times to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_word_ends</methodname>() method calls
the <link
linkend="method-gtktextiter--forward-word-end"><methodname>forward_word_end</methodname>()</link> 
method up to <parameter>count</parameter> times or the <link
linkend="method-gtktextiter--backward-word-starts"><methodname>backward_word_starts</methodname>()</link> 
method if <parameter>count</parameter> is negative. The method returns
<literal>True</literal> if the textiter location changed and the resulting
location is not at the end of the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-word-starts">
      <title>gtk.TextIter.backward_word_starts</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_word_starts</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of times to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_word_starts(</methodname>) method calls the
<link
linkend="method-gtktextiter--backward-word-start"><methodname>backward_word_start</methodname>()</link> 
method up to <parameter>count</parameter> times or the <link
linkend="method-gtktextiter--forward-word-ends"><methodname>forward_word_ends</methodname>()</link> 
method if <parameter>count</parameter> is negative. The method returns
<literal>True</literal> if the textiter location changed and the resulting
location is not at the end of the textbuffer.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--forward-word-end">
      <title>gtk.TextIter.forward_word_end</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_word_end</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved to a dereferenceable position</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_word_end</methodname>() method moves the
textiter location forward to the next word end. If the textiter location is
currently on a word end, the location moves forward to the next one after
that. Word breaks are determined by Pango and should be correct for nearly
any language (if not, the correct fix would be to the Pango word break
algorithms). The method returns True if the textiter location moved to a
dereferenceable position</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-word-start">
      <title>gtk.TextIter.backward_word_start</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_word_start</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_word_start</methodname>() method moves
the textiter location backward to the previous word start. If the textiter
location is currently on a word start, the location moves backward to the
next one before that. Word breaks are determined by Pango and should be
correct for nearly any language (if not, the correct fix would be to the
Pango word break algorithms). The method returns <literal>True</literal> if
the textiter location moved.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-cursor-position">
      <title>gtk.TextIter.forward_cursor_position</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_cursor_position</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if we moved and the new
position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_cursor_position</methodname>() method
moves the textiter location forward by a single cursor position. Cursor
positions are (unsurprisingly) positions where the cursor can appear.
Surprisingly, there may not be a cursor position between all characters. The
most common example for European languages would be a carriage
return/newline sequence. For some Unicode characters, the equivalent of say
the letter "a" with an accent mark will be represented as two characters,
first the letter then a "combining mark" that causes the accent to be
rendered; so the cursor can't go between those two characters. The method
returns <literal>True</literal> if the textiter location changed and the
resulting location is not at the end of the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-cursor-position">
      <title>gtk.TextIter.backward_cursor_position</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_cursor_position</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if we moved and the new
position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_cursor_position</methodname>() method
is similar to the <link
linkend="method-gtktextiter--forward-cursor-position"><methodname>forward_cursor_position</methodname>()</link> 
method, except the location moves backward.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-cursor-positions">
      <title>gtk.TextIter.forward_cursor_positions</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_cursor_positions</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of positions to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and the new position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_cursor_positions</methodname>() method
moves up to <parameter>count</parameter> cursor positions. See the <link
linkend="method-gtktextiter--forward-cursor-position"><methodname>forward_cursor_position</methodname>()</link> 
method for more details. The method returns <literal>True</literal> if the
textiter moved to a dereferenceable location.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-cursor-positions">
      <title>gtk.TextIter.backward_cursor_positions</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_cursor_positions</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of positions to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and the new position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_cursor_positions</methodname>() method
moves the textiter location up to <parameter>count</parameter> cursor
positions. See the <link
linkend="method-gtktextiter--forward-cursor-position"><methodname>forward_cursor_position</methodname>()</link> 
method for details.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-sentence-start">
      <title>gtk.TextIter.backward_sentence_start</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_sentence_start</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_sentence_start</methodname>() method
moves the textiter location backward to the previous sentence start. If the
textiter location is already at the start of a sentence, the location moves
backward to the next one.  Sentence boundaries are determined by Pango and
should be correct for nearly any language (if not, the correct fix would be
to the Pango text boundary algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-sentence-end">
      <title>gtk.TextIter.forward_sentence_end</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_sentence_end</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_sentence_end</methodname>() method moves
the textiter location forward to the next sentence end. (If the textiter
location is at the end of a sentence, the location moves to the next end of
sentence.)  Sentence boundaries are determined by Pango and should be
correct for nearly any language (if not, the correct fix would be to the
Pango text boundary algorithms). The method returns <literal>True</literal>
if the textiter location changed and the resulting location is not at the
end of the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-sentence-starts">
      <title>gtk.TextIter.backward_sentence_starts</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_sentence_starts</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of sentences to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_sentence_starts</methodname>() method
calls the <link
linkend="method-gtktextiter--backward-sentence-start"><methodname>backward_sentence_start</methodname>()</link> 
method (or the <link
linkend="method-gtktextiter--forward-sentence-end"><methodname>forward_sentence_end</methodname>()</link>() 
method if count is negative) up to <parameter>count</parameter> times, or
until it returns <literal>False</literal>. If <parameter>count</parameter>
is negative, the location moves forward instead of backward. The method
returns <literal>True</literal> if the textiter location changed and the
resulting location is not at the end of the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-sentence-ends">
      <title>gtk.TextIter.forward_sentence_ends</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_sentence_ends</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of sentences to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_sentence_ends</methodname>() method
calls the <link
linkend="method-gtktextiter--forward-sentence-end"><methodname>forward_sentence_end</methodname>()</link> 
method <parameter>count</parameter> times (or until the <link
linkend="method-gtktextiter--forward-sentence-end"><methodname>forward_sentence_end</methodname>()</link> 
method returns <literal>False</literal>). If <parameter>count</parameter> is
negative, the location moves backward instead of forward. The method returns
<literal>True</literal> if the textiter location changed and the resulting
location is not at the end of the textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-word-ends">
      <title>gtk.TextIter.forward_visible_word_ends</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_word_ends</methodname>
	  <methodparam><parameter role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of times to move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter moved
	  and is not the end iterator</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_word_ends</methodname>() method
calls the <link
linkend="method-gtktextiter--forward-visible-word-end"><methodname>forward_visible_word_end()</methodname></link>
method the number of times specified by <parameter>count</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-visible-word-starts">
      <title>gtk.TextIter.backward_visible_word_starts</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_word_starts</methodname>
	  <methodparam><parameter role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of times to move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter moved
	  and is not the end iterator</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_word_starts</methodname>()
method calls the <link
linkend="method-gtktextiter--backward-visible-word-start"><methodname>backward_visible_word_start()</methodname></link>
method the number of times specified by <parameter>count</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-word-end">
      <title>gtk.TextIter.forward_visible_word_end</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_word_end</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter moved
	  and is not the end iterator</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_word_end</methodname>() method
moves the textiter forward to the next visible word end. (If the textiter is
currently on a word end, it moves forward to the next one after that.) Word
breaks are determined by Pango and should be correct for nearly any language
(if not, the correct fix would be to the Pango word break
algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-visible-word-start">
      <title>gtk.TextIter.backward_visible_word_start</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_word_start</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter moved
	  and is not the end iterator</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_word_start</methodname>()
method moves the textiter backward to the previous visible word start. (If
textiter is currently on a word start, it moves backward to the next one
after that.) Word breaks are determined by Pango and should be correct for
nearly any language (if not, the correct fix would be to the Pango word
break algorithms).</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-cursor-position">
      <title>gtk.TextIter.forward_visible_cursor_position</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_cursor_position</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if we moved and the new
position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_cursor_position</methodname>()
method moves the textiter location forward by a single visible cursor
position. Cursor positions are (unsurprisingly) positions where the cursor
can appear.  Surprisingly, there may not be a cursor position between all
characters. The most common example for European languages would be a
carriage return/newline sequence. For some Unicode characters, the
equivalent of say the letter "a" with an accent mark will be represented as
two characters, first the letter then a "combining mark" that causes the
accent to be rendered; so the cursor can't go between those two
characters. The method returns <literal>True</literal> if the textiter
location changed and the resulting location is not at the end of the
textbuffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-visible-cursor-position">
      <title>gtk.TextIter.backward_visible_cursor_position</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_cursor_position</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if we moved and the new
position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_cursor_position</methodname>()
method is similar to the <link
linkend="method-gtktextiter--forward-visible-cursor-position"><methodname>forward_visible_cursor_position</methodname>()</link>
method, except the location moves backward.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-cursor-positions">
      <title>gtk.TextIter.forward_visible_cursor_positions</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_cursor_positions</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of positions to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and the new position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_cursor_positions</methodname>()
method moves up to <parameter>count</parameter> visible cursor
positions. See the <link
linkend="method-gtktextiter--forward-visible-cursor-position"><methodname>forward_visible_cursor_position</methodname>()</link>
method for more details. The method returns <literal>True</literal> if the
textiter moved to a dereferenceable location.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-visible-cursor-positions">
      <title>gtk.TextIter.backward_visible_cursor_positions</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_cursor_positions</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of positions to
move</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and the new position is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_cursor_positions</methodname>()
method moves the textiter location up to <parameter>count</parameter>
visible cursor positions. See the <link
linkend="method-gtktextiter--forward-visible-cursor-position"><methodname>forward_visible_cursor_position</methodname>()</link>
method for details.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-line">
      <title>gtk.TextIter.forward_visible_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location can be dereferenced</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_line</methodname>() method moves
the textiter location to the start of the next visible line and returns
<literal>True</literal> if the textiter location moved to a dereferenceable
position, and <literal>False</literal> if the textiter location moved to the
end of the buffer, or if the textiter location was originally at the end of
the buffer.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--backward-visible-line">
      <title>gtk.TextIter.backward_visible_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_line</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_line</methodname>() method
moves the textiter location to the start of the previous visible line and
returns <literal>True</literal> if the textiter location was moved. If the
textiter location was at the textbuffer start, this method returns
<literal>False</literal>. For example if the textiter location was already
on line 0, but not at the start of the line, the textiter location is
snapped to the start of the line and the method returns
<literal>True</literal>.</para>


    </refsect2>

    <refsect2 id="method-gtktextiter--forward-visible-lines">
      <title>gtk.TextIter.forward_visible_lines</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_visible_lines</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of visible lines to move forward,
may be negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved and is dereferenceable</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_visible_lines</methodname>() method
moves the textiter location forward <parameter>count</parameter> visible
lines, if possible.  If the textiter location would move past the start or
end of the buffer, the location moves to the start or end of the textbuffer.
The method returns:</para>

      <itemizedlist>
	<listitem>
	  <simpara><literal>True</literal> if the textiter moved to a
dereferenceable position; or,</simpara>
	</listitem>
	<listitem>
	  <simpara><literal>False</literal> if the textiter location didn't
move, or moved onto the end textiter or if <parameter>count</parameter> was
0.</simpara>
	</listitem>
      </itemizedlist>

      <para>If <parameter>count</parameter> is negative, the textiter
location moves backward by <parameter>count</parameter> visible lines.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-visible-lines">
      <title>gtk.TextIter.backward_visible_lines</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_visible_lines</methodname>
	  <methodparam><parameter
			 role="keyword">count</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">count</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of visible lines to move backward,
may be negative</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location moved to a dereferenceable position</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_visible_lines</methodname>() method
moves the textiter location backward by <parameter>count</parameter> lines,
if possible. If the textiter location would move past the start or end of
the buffer, the location moves to the start or end of the textbuffer.  The
method returns:</para>

      <itemizedlist>
	<listitem>
	  <simpara><literal>True</literal> if the textiter moved to a
dereferenceable position; or,</simpara>
	</listitem>
	<listitem>
	  <simpara><literal>False</literal> if the textiter location didn't
move, or moved onto the end textiter or if <parameter>count</parameter> was
0.</simpara>
	</listitem>
      </itemizedlist>

      <para>If <parameter>count</parameter> is negative, the textiter
location moves forward by <parameter>count</parameter> visible lines.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--set-offset">
      <title>gtk.TextIter.set_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_offset</methodname>
	  <methodparam><parameter
			 role="keyword">char_offset</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">char_offset</parameter>&nbsp;:</term>
	  <listitem><simpara>a character number</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_offset</methodname>() method sets the
textiter location to point to the location that is
<parameter>char_offset</parameter> counts from the start of the textbuffer
(starting with 0).</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--set-line">
      <title>gtk.TextIter.set_line</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_line</methodname>
	  <methodparam><parameter
			 role="keyword">line_number</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">line_number</parameter>&nbsp;:</term>
	  <listitem><simpara>a line number (counted from
0)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_line</methodname>() method sets the textiter
location to the start of the line specified by
<parameter>line_number</parameter>.  If <parameter>line_number</parameter>
is negative or larger than the number of lines in the textbuffer, the method
moves the textiter location to the start of the last line in the
buffer.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--set-line-offset">
      <title>gtk.TextIter.set_line_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_line_offset</methodname>
	  <methodparam><parameter
			 role="keyword">char_on_line</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">char_on_line</parameter>&nbsp;:</term>
	  <listitem><simpara>a character offset relative to the start of the
textiter location's current line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_line_offset</methodname>() method moves the
textiter location within a line, to the new <emphasis>character</emphasis>
(not byte) offset specified by <parameter>char_on_line</parameter>. The
character offset must be less than or equal to the number of characters in
the line; if equal, the textiter location moves to the start of the next
line. See the <link
linkend="method-gtktextiter--set-line-index"><methodname>set_line_index</methodname>()</link> 
method if you have a byte index rather than a character offset.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--set-line-index">
      <title>gtk.TextIter.set_line_index</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_line_index</methodname>
	  <methodparam><parameter
			 role="keyword">byte_on_line</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">byte_on_line</parameter>&nbsp;:</term>
	  <listitem><simpara>a byte index relative to the start of the
textiter location's current line</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_line_index</methodname>() method is similar
to the <link
linkend="method-gtktextiter--set-line-offset"><methodname>set_line_offset</methodname>()</link>, 
but works with a <emphasis>byte</emphasis> index instead of a character
index. The given byte index must be at the start of a character, it can't be
in the middle of a UTF-8 encoded character.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-to-end">
      <title>gtk.TextIter.forward_to_end</title>

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

      <para>The <methodname>forward_to_end</methodname>() method moves the
textiter location forward to the "end textiter," that points one past the
last valid character in the buffer. The <link
linkend="method-gtktextiter--get-char"><methodname>get_char</methodname>()</link> 
method called on the end textiter returns 0, which is convenient for writing
loops.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--forward-to-line-end">
      <title>gtk.TextIter.forward_to_line_end</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_to_line_end</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if we moved and the new
location is not the end textiter</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_to_line_end</methodname>() method moves
the textiter to point to the paragraph delimiter characters at the end of
the current line. The paragraph delimiter characters are a newline, a
carriage return, a carriage return-newline in sequence, or the Unicode
paragraph separator character. If the textiter is already at the paragraph
delimiter characters, moves to the paragraph delimiter characters for the
next line. If the textiter location is on the last line in the buffer, which
does not end in paragraph delimiters, moves to the end textiter (end of the
last line), and returns <literal>False</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--set-visible-line-offset">
      <title>gtk.TextIter.set_visible_line_offset</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_visible_line_offset</methodname>
	  <methodparam><parameter
			 role="keyword">char_on_line</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">char_on_line</parameter>&nbsp;:</term>
	  <listitem><simpara>a character offset</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_visible_char_offset</methodname>() method is
similar to the <link
linkend="method-gtktextiter--set-line-offset"><methodname>set_line_offset</methodname>()</link> 
method, but the offset is in visible characters, i.e. text with the
invisible attribute set is not counted in the offset.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--set-visible-line-index">
      <title>gtk.TextIter.set_visible_line_index</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_visible_line_index</methodname>
	  <methodparam><parameter
			 role="keyword">byte_on_line</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">byte_on_line</parameter>&nbsp;:</term>
	  <listitem><simpara>a byte index</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_visible_line_index</methodname>() method is
similar to the <link
linkend="method-gtktextiter--set-line-index"><methodname>set_line_index</methodname>()</link> 
method, but the index is in visible bytes, i.e. text with the attribute set
is not counted in the index.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-to-tag-toggle">
      <title>gtk.TextIter.forward_to_tag_toggle</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_to_tag_toggle</methodname>
	  <methodparam><parameter
			 role="keyword">tag</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if a tag toggle was
found after the textiter location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_to_tag_toggle</methodname>() method
moves the textiter location forward to the next toggle (on or off) of the
<link linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>
specified by <parameter>tag</parameter>, or to the next toggle of any tag if
<parameter>tag</parameter> is <literal>None</literal>. If no matching tag
toggles are found, this method returns <literal>False</literal> and sets the
textiter location to the end of the textbuffer; otherwise, returns
<literal>True</literal>. The
<methodname>forward_to_tag_toggle</methodname>() method does not recognize
toggles located at the textiter location, only toggles after the textiter
location.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-to-tag-toggle">
      <title>gtk.TextIter.backward_to_tag_toggle</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_to_tag_toggle</methodname>
	  <methodparam><parameter
			 role="keyword">tag</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">tag</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if a tag toggle was
found before the textiter location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_to_tag_toggle</methodname>() method
moves the textiter location backward to the next toggle (on or off) of the
<link linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link>
specified by <parameter>tag</parameter>, or to the next toggle of any tag if
<parameter>tag</parameter> is <literal>None</literal>. If no matching tag
toggles are found, this method returns <literal>False</literal> and sets the
textiter location to the start of the textbuffer; otherwise, returns
<literal>True</literal>. The
<methodname>backward_to_tag_toggle</methodname>() method does not recognize
toggles located at the textiter location, only toggles before the textiter
location.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-find-char">
    <title>gtk.TextIter.forward_find_char</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_find_char</methodname>
	  <methodparam><parameter role="keyword">pred</parameter></methodparam>
	  <methodparam><parameter role="keyword">user_data</parameter></methodparam>
	  <methodparam><parameter role="keyword">limit</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">pred</parameter>&nbsp;:</term>
	  <listitem><simpara>a function to be called on each
	  character</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
	  role="keyword">user_data</parameter>&nbsp;:</term>
	  <listitem><simpara>user data for
	  <parameter>pred</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">limit</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
	  pointing at a position to end the search, or
	  <literal>None</literal> for the end of the
	  buffer.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if a match was
	  found</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>forward_find_char</methodname>() method advances
the textiter, calling the function specified by <parameter>pred</parameter>
on each character. If <parameter>pred</parameter> returns
<literal>True</literal>, <methodname>forward_find_char</methodname> stops
scanning and returns <literal>True</literal>. If <parameter>pred</parameter>
never returns <literal>True</literal>, the textiter location is set to
<parameter>limit</parameter> or the end textiter, if
<parameter>limit</parameter> is <literal>None</literal>.</para>

      <warning>
	<para> This method is likely to be very slow since the Python
function <parameter>pred</parameter> is called for every character.</para>
      </warning>

    </refsect2>

  <refsect2 id="method-gtktextiter--backward-find-char">
    <title>gtk.TextIter.backward_find_char</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_find_char</methodname>
	  <methodparam><parameter role="keyword">pred</parameter></methodparam>
	  <methodparam><parameter role="keyword">user_data</parameter></methodparam>
	  <methodparam><parameter role="keyword">limit</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">pred</parameter>&nbsp;:</term>
	  <listitem><simpara>a function to be called on each
	  character</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">user_data</parameter>&nbsp;:</term>
	  <listitem><simpara>user data for <parameter>pred</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">limit</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
	  pointing at a position to end the search, or
	  <literal>None</literal> for the beginning of the
	  buffer.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if a match was
	  found</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>backward_find_char</methodname>() method is
similar to the <link
linkend="method-gtktextiter--forward-find-char"><methodname>forward_find_char()</methodname></link>
method, but goes backward from the textiter location.</para>

      <warning>
	<para> This method is likely to be very slow since the Python
function <parameter>pred</parameter> is called for every character.</para>
      </warning>

    </refsect2>

    <refsect2 id="method-gtktextiter--forward-search">
      <title>gtk.TextIter.forward_search</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>forward_search</methodname>
	  <methodparam><parameter
			 role="keyword">str</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">flags</parameter></methodparam>
	  <methodparam><parameter role="keyword">limit</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">str</parameter>&nbsp;:</term>
	  <listitem><simpara>a search string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">flags</parameter>&nbsp;:</term>
	  <listitem><simpara>the flags affecting how the search is
done</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">limit</parameter>&nbsp;:</term>
	  <listitem><simpara>a bound for the search, or
<literal>None</literal> to set the bound to the end of the buffer</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a tuple containing <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
objects pointing at the start and end locations of the
match</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>forward_search</methodname>() method searches
forward for the text string specified by <parameter>str</parameter> and
returns a tuple containing <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
objects that point at the start and end locations of the match. The search
will stop at the location specified by <parameter>limit</parameter> or the
end of the textbuffer if <parameter>limit</parameter> is
<literal>None</literal> or is not specified. Note that a search is a linear
or O(n) operation, so you may wish to use <parameter>limit</parameter> to
avoid locking up your UI when searching large buffers.</para>

      <para>If the <literal>gtk.TEXT_SEARCH_VISIBLE_ONLY</literal> flag is
present, the match may have invisible text interspersed in
<parameter>str</parameter> (i.e. <parameter>str</parameter> will be a
possibly-noncontiguous subsequence of the matched range). Likewise, if
<literal>gtk.TEXT_SEARCH_TEXT_ONLY</literal> is present, the match may have
pixbufs or child anchors mixed inside the matched range. If these flags are
not given, the match must be exact i.e. the special 0xFFFC character in
<parameter>str</parameter> will match embedded pixbufs or child
widgets.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--backward-search">
      <title>gtk.TextIter.backward_search</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>backward_search</methodname>
	  <methodparam><parameter
			 role="keyword">str</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">flags</parameter></methodparam>
	  <methodparam><parameter role="keyword">limit</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">str</parameter>&nbsp;:</term>
	  <listitem><simpara>a search string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">flags</parameter>&nbsp;:</term>
	  <listitem><simpara>the flags affecting the
search</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">limit</parameter>&nbsp;:</term>
	  <listitem><simpara>a bound for the search, or
<literal>None</literal> to set the bound to the end of the
buffer</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>start of match and end of
match</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>backward_search</methodname>() method is the
same as the <link
linkend="method-gtktextiter--forward-search"><methodname>forward_search</methodname>()</link> 
method, except searches backward.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--equal">
      <title>gtk.TextIter.equal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>equal</methodname>
	  <methodparam><parameter
			 role="keyword">rhs</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">rhs</parameter>&nbsp;:</term>
	  <listitem><simpara>another <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
object</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiters point
to the same place in the buffer</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>equal</methodname>() method tests if the
textiter specified by <parameter>rhs</parameter> points to the same location
in the textbuffer as the textiter.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--compare">
      <title>gtk.TextIter.compare</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>compare</methodname>
	  <methodparam><parameter
			 role="keyword">rhs</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">rhs</parameter>&nbsp;:</term>
	  <listitem><simpara>another <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
object</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>-1 if the textiter location is less than the
<parameter>rhs</parameter> location, 1 if the textiter location is greater,
0 if they are equal</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>compare</methodname>() method returns:</para>

      <itemizedlist>
	<listitem>
	  <simpara>-1 if the textiter location is less than the location of
the textiter specified by <parameter>rhs</parameter>;</simpara>
	</listitem>
	<listitem>
	  <simpara>1 if the textiter location is greater than the location
of the textiter specified by <parameter>rhs</parameter>; and,</simpara>
	</listitem>
	<listitem>
	  <simpara>0 if the textiter location is equal to the location of
the textiter specified by <parameter>rhs</parameter>.</simpara>
	</listitem>
      </itemizedlist>

      <para>Ordering is in character offset order, i.e. the first character
in the buffer is less than the second character in the buffer.</para>

    </refsect2>

    <refsect2 id="method-gtktextiter--in-range">
      <title>gtk.TextIter.in_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>in_range</methodname>
	  <methodparam><parameter
			 role="keyword">start</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">start</parameter>&nbsp;:</term>
	  <listitem><simpara>the start of the text
range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>the end of the text range</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the textiter
location is in the text range</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>in_range</methodname>() method returns
<literal>True</literal> if the textiter location is in the text range
specified by the <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
objects <parameter>start</parameter> and <parameter>end</parameter>.
<parameter>start</parameter> and <parameter>end</parameter> must be in
ascending order.</para>

    </refsect2>

  <refsect2 id="method-gtktextiter--order">
      <title>gtk.TextIter.order</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>order</methodname>
	  <methodparam><parameter
			 role="keyword">second</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">second</parameter>&nbsp;:</term>
	  <listitem><simpara>another <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
object</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The order() method swaps the locations of
<parameter>first</parameter> and <parameter>second</parameter> if
<parameter>second</parameter> comes before <parameter>first</parameter> in
the buffer. This method can be used to ensure that
<parameter>first</parameter> and <parameter>second</parameter> are in
sequence. Most text buffer methods that take a range call this
automatically, so there's no real reason to call it yourself in those cases.
There are some exceptions, such as the <link
linkend="method-gtktextiter--in-range"><methodname>in_range</methodname>()</link>, 
that expect a pre-sorted range.</para>

    </refsect2>

  </refsect1>

</refentry>
