<refentry id="GtkTextBuffer">
<refmeta>
<refentrytitle>GtkTextBuffer</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkTextBuffer</refname><refpurpose>
Stores attributed text for display in a <link
linkend="GtkTextView">GtkTextView</link></refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gtk/gtk.h&gt;


struct      <link linkend="GtkTextBuffer-struct">GtkTextBuffer</link>;
<link linkend="GtkTextBuffer">GtkTextBuffer</link>* <link linkend="gtk-text-buffer-new">gtk_text_buffer_new</link>          (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);
<link linkend="gint">gint</link>        <link linkend="gtk-text-buffer-get-line-count">gtk_text_buffer_get_line_count</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="gint">gint</link>        <link linkend="gtk-text-buffer-get-char-count">gtk_text_buffer_get_char_count</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GtkTextTagTable">GtkTextTagTable</link>* <link linkend="gtk-text-buffer-get-tag-table">gtk_text_buffer_get_tag_table</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
void        <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);
void        <link linkend="gtk-text-buffer-insert-at-cursor">gtk_text_buffer_insert_at_cursor</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-insert-interactive">gtk_text_buffer_insert_interactive</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-insert-interactive-at-cursor">gtk_text_buffer_insert_interactive_at_cursor</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="gboolean">gboolean</link> default_editable);
void        <link linkend="gtk-text-buffer-insert-range">gtk_text_buffer_insert_range</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-insert-range-interactive">gtk_text_buffer_insert_range_interactive</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> default_editable);
void        <link linkend="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *first_tag,
                                             ...);
void        <link linkend="gtk-text-buffer-insert-with-tags-by-name">gtk_text_buffer_insert_with_tags_by_name</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             const <link linkend="gchar">gchar</link> *first_tag_name,
                                             ...);
void        <link linkend="gtk-text-buffer-delete">gtk_text_buffer_delete</link>          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-delete-interactive">gtk_text_buffer_delete_interactive</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start_iter,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end_iter,
                                             <link linkend="gboolean">gboolean</link> default_editable);
void        <link linkend="gtk-text-buffer-set-text">gtk_text_buffer_set_text</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);
<link linkend="gchar">gchar</link>*      <link linkend="gtk-text-buffer-get-text">gtk_text_buffer_get_text</link>        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> include_hidden_chars);
<link linkend="gchar">gchar</link>*      <link linkend="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> include_hidden_chars);
void        <link linkend="gtk-text-buffer-insert-pixbuf">gtk_text_buffer_insert_pixbuf</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
void        <link linkend="gtk-text-buffer-insert-child-anchor">gtk_text_buffer_insert_child_anchor</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);
<link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link>* <link linkend="gtk-text-buffer-create-child-anchor">gtk_text_buffer_create_child_anchor</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);
<link linkend="GtkTextMark">GtkTextMark</link>* <link linkend="gtk-text-buffer-create-mark">gtk_text_buffer_create_mark</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *mark_name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where,
                                             <link linkend="gboolean">gboolean</link> left_gravity);
void        <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);
void        <link linkend="gtk-text-buffer-move-mark-by-name">gtk_text_buffer_move_mark_by_name</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);
void        <link linkend="gtk-text-buffer-delete-mark">gtk_text_buffer_delete_mark</link>     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark);
void        <link linkend="gtk-text-buffer-delete-mark-by-name">gtk_text_buffer_delete_mark_by_name</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name);
<link linkend="GtkTextMark">GtkTextMark</link>* <link linkend="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name);
<link linkend="GtkTextMark">GtkTextMark</link>* <link linkend="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert</link>     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="GtkTextMark">GtkTextMark</link>* <link linkend="gtk-text-buffer-get-selection-bound">gtk_text_buffer_get_selection_bound</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
void        <link linkend="gtk-text-buffer-place-cursor">gtk_text_buffer_place_cursor</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);
void        <link linkend="gtk-text-buffer-apply-tag">gtk_text_buffer_apply_tag</link>       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
void        <link linkend="gtk-text-buffer-remove-tag">gtk_text_buffer_remove_tag</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
void        <link linkend="gtk-text-buffer-apply-tag-by-name">gtk_text_buffer_apply_tag_by_name</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
void        <link linkend="gtk-text-buffer-remove-tag-by-name">gtk_text_buffer_remove_tag_by_name</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
void        <link linkend="gtk-text-buffer-remove-all-tags">gtk_text_buffer_remove_all_tags</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="GtkTextTag">GtkTextTag</link>* <link linkend="gtk-text-buffer-create-tag">gtk_text_buffer_create_tag</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *tag_name,
                                             const <link linkend="gchar">gchar</link> *first_property_name,
                                             ...);
void        <link linkend="gtk-text-buffer-get-iter-at-line-offset">gtk_text_buffer_get_iter_at_line_offset</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number,
                                             <link linkend="gint">gint</link> char_offset);
void        <link linkend="gtk-text-buffer-get-iter-at-offset">gtk_text_buffer_get_iter_at_offset</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> char_offset);
void        <link linkend="gtk-text-buffer-get-iter-at-line">gtk_text_buffer_get_iter_at_line</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number);
void        <link linkend="gtk-text-buffer-get-iter-at-line-index">gtk_text_buffer_get_iter_at_line_index</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number,
                                             <link linkend="gint">gint</link> byte_index);
void        <link linkend="gtk-text-buffer-get-iter-at-mark">gtk_text_buffer_get_iter_at_mark</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark);
void        <link linkend="gtk-text-buffer-get-iter-at-child-anchor">gtk_text_buffer_get_iter_at_child_anchor</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);
void        <link linkend="gtk-text-buffer-get-start-iter">gtk_text_buffer_get_start_iter</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);
void        <link linkend="gtk-text-buffer-get-end-iter">gtk_text_buffer_get_end_iter</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);
void        <link linkend="gtk-text-buffer-get-bounds">gtk_text_buffer_get_bounds</link>      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-get-modified">gtk_text_buffer_get_modified</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
void        <link linkend="gtk-text-buffer-set-modified">gtk_text_buffer_set_modified</link>    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="gboolean">gboolean</link> setting);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-delete-selection">gtk_text_buffer_delete_selection</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="gboolean">gboolean</link> interactive,
                                             <link linkend="gboolean">gboolean</link> default_editable);
void        <link linkend="gtk-text-buffer-paste-clipboard">gtk_text_buffer_paste_clipboard</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *override_location,
                                             <link linkend="gboolean">gboolean</link> default_editable);
void        <link linkend="gtk-text-buffer-copy-clipboard">gtk_text_buffer_copy_clipboard</link>  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);
void        <link linkend="gtk-text-buffer-cut-clipboard">gtk_text_buffer_cut_clipboard</link>   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                             <link linkend="gboolean">gboolean</link> default_editable);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-text-buffer-get-selection-bounds">gtk_text_buffer_get_selection_bounds</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);
void        <link linkend="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
void        <link linkend="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action</link> (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
void        <link linkend="gtk-text-buffer-add-selection-clipboard">gtk_text_buffer_add_selection_clipboard</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);
void        <link linkend="gtk-text-buffer-remove-selection-clipboard">gtk_text_buffer_remove_selection_clipboard</link>
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----GtkTextBuffer
</synopsis>

</refsect1>


<refsect1>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="GtkTextBuffer-apply-tag">apply-tag</link>&quot; void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextTag">GtkTextTag</link> *arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-begin-user-action">begin-user-action</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-changed">changed</link>&quot;   void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-delete-range">delete-range</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-end-user-action">end-user-action</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-insert-child-anchor">insert-child-anchor</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-insert-pixbuf">insert-pixbuf</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GdkPixbuf">GdkPixbuf</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-insert-text">insert-text</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="gchar">gchar</link> *arg2,
                                            <link linkend="gint">gint</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-mark-deleted">mark-deleted</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextMark">GtkTextMark</link> *arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-mark-set">mark-set</link>&quot;  void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextMark">GtkTextMark</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-modified-changed">modified-changed</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkTextBuffer-remove-tag">remove-tag</link>&quot;
            void        user_function      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextTag">GtkTextTag</link> *arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>

<para>
You may wish to begin by reading the <link linkend="TextWidget">text widget
conceptual overview</link> which gives an overview of all the objects and data
types related to the text widget and how they work together.
</para>

<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GtkTextBuffer-struct">struct GtkTextBuffer</title>
<programlisting>struct GtkTextBuffer;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-new">gtk_text_buffer_new ()</title>
<programlisting><link linkend="GtkTextBuffer">GtkTextBuffer</link>* gtk_text_buffer_new          (<link linkend="GtkTextTagTable">GtkTextTagTable</link> *table);</programlisting>
<para>
Creates a new text buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>table</parameter>&nbsp;:</entry>
<entry> a tag table, or NULL to create a new one
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new text buffer
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-line-count">gtk_text_buffer_get_line_count ()</title>
<programlisting><link linkend="gint">gint</link>        gtk_text_buffer_get_line_count  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Obtains the number of lines in the buffer. This value is cached, so
the function is very fast.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> number of lines in the buffer
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-char-count">gtk_text_buffer_get_char_count ()</title>
<programlisting><link linkend="gint">gint</link>        gtk_text_buffer_get_char_count  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Gets the number of characters in the buffer; note that characters
and bytes are not the same, you can't e.g. expect the contents of
the buffer in string form to be this many bytes long. The character
count is cached, so this function is very fast.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> number of characters in the buffer
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-tag-table">gtk_text_buffer_get_tag_table ()</title>
<programlisting><link linkend="GtkTextTagTable">GtkTextTagTable</link>* gtk_text_buffer_get_tag_table
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Get the <link linkend="GtkTextTagTable">GtkTextTagTable</link> associated with this buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the buffer's tag table
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert">gtk_text_buffer_insert ()</title>
<programlisting>void        gtk_text_buffer_insert          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);</programlisting>
<para>
Inserts <parameter>len</parameter> bytes of <parameter>text</parameter> at position <parameter>iter</parameter>.  If <parameter>len</parameter> is -1,
<parameter>text</parameter> must be nul-terminated and will be inserted in its
entirety. Emits the "insert_text" signal; insertion actually occurs
in the default handler for the signal. <parameter>iter</parameter> is invalidated when
insertion occurs (because the buffer contents change), but the
default signal handler revalidates it to point to the end of the
inserted text.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> a position in the buffer
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> UTF-8 format text to insert
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of text in bytes, or -1
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-at-cursor">gtk_text_buffer_insert_at_cursor ()</title>
<programlisting>void        gtk_text_buffer_insert_at_cursor
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);</programlisting>
<para>
Simply calls <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert</link>(), using the current
cursor position as the insertion point.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> some text in UTF-8 format
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of text, in bytes
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-interactive">gtk_text_buffer_insert_interactive ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_insert_interactive
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Like <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert</link>(), but the insertion will not occur if
<parameter>iter</parameter> is at a non-editable location in the buffer.  Usually you
want to prevent insertions at ineditable locations if the insertion
results from a user action (is interactive).
</para>
<para>
<parameter>default_editable</parameter> indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of <link linkend="gtk-text-view-get-editable">gtk_text_view_get_editable</link>() is appropriate here.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> a position in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> some UTF-8 text
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of text in bytes, or -1
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> default editability of buffer
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether text was actually inserted
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-interactive-at-cursor">gtk_text_buffer_insert_interactive_at_cursor ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_insert_interactive_at_cursor
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Calls <link linkend="gtk-text-buffer-insert-interactive">gtk_text_buffer_insert_interactive</link>() at the cursor
position.
</para>
<para>
<parameter>default_editable</parameter> indicates the editability of text that doesn't
have a tag affecting editability applied to it. Typically the
result of <link linkend="gtk-text-view-get-editable">gtk_text_view_get_editable</link>() is appropriate here.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> text in UTF-8 format
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of text in bytes, or -1
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> default editability of buffer
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether text was actually inserted
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-range">gtk_text_buffer_insert_range ()</title>
<programlisting>void        gtk_text_buffer_insert_range    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Copies text, tags, and pixbufs between <parameter>start</parameter> and <parameter>end</parameter> (the order
of <parameter>start</parameter> and <parameter>end</parameter> doesn't matter) and inserts the copy at <parameter>iter</parameter>.
Used instead of simply getting/inserting text because it preserves
images and tags. If <parameter>start</parameter> and <parameter>end</parameter> are in a different buffer from
<parameter>buffer</parameter>, the two buffers must share the same tag table.
</para>
<para>
Implemented via emissions of the insert_text and apply_tag signals,
so expect those.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> a position in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> a position in a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> another position in the same buffer as <parameter>start</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-range-interactive">gtk_text_buffer_insert_range_interactive ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_insert_range_interactive
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Same as <link linkend="gtk-text-buffer-insert-range">gtk_text_buffer_insert_range</link>(), but does nothing if the
insertion point isn't editable. The <parameter>default_editable</parameter> parameter
indicates whether the text is editable at <parameter>iter</parameter> if no tags
enclosing <parameter>iter</parameter> affect editability. Typically the result of
<link linkend="gtk-text-view-get-editable">gtk_text_view_get_editable</link>() is appropriate here.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> a position in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> a position in a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> another position in the same buffer as <parameter>start</parameter>
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> default editability of the buffer
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether an insertion was possible at <parameter>iter</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags ()</title>
<programlisting>void        gtk_text_buffer_insert_with_tags
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *first_tag,
                                             ...);</programlisting>
<para>
Inserts <parameter>text</parameter> into <parameter>buffer</parameter> at <parameter>iter</parameter>, applying the list of tags to
the newly-inserted text. The last tag specified must be NULL to
terminate the list. Equivalent to calling <link linkend="gtk-text-buffer-insert">gtk_text_buffer_insert</link>(),
then <link linkend="gtk-text-buffer-apply-tag">gtk_text_buffer_apply_tag</link>() on the inserted text;
<link linkend="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags</link>() is just a convenience function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> an iterator in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> UTF-8 text
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of <parameter>text</parameter>, or -1
</entry></row>
<row><entry align="right"><parameter>first_tag</parameter>&nbsp;:</entry>
<entry> first tag to apply to <parameter>text</parameter>
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry> NULL-terminated list of tags to apply
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-with-tags-by-name">gtk_text_buffer_insert_with_tags_by_name ()</title>
<programlisting>void        gtk_text_buffer_insert_with_tags_by_name
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len,
                                             const <link linkend="gchar">gchar</link> *first_tag_name,
                                             ...);</programlisting>
<para>
Same as <link linkend="gtk-text-buffer-insert-with-tags">gtk_text_buffer_insert_with_tags</link>(), but allows you
to pass in tag names instead of tag objects.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> position in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> UTF-8 text
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of <parameter>text</parameter>, or -1
</entry></row>
<row><entry align="right"><parameter>first_tag_name</parameter>&nbsp;:</entry>
<entry> name of a tag to apply to <parameter>text</parameter>
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry> more tag names
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-delete">gtk_text_buffer_delete ()</title>
<programlisting>void        gtk_text_buffer_delete          (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Deletes text between <parameter>start</parameter> and <parameter>end</parameter>. The order of <parameter>start</parameter> and <parameter>end</parameter>
is not actually relevant; <link linkend="gtk-text-buffer-delete">gtk_text_buffer_delete</link>() will reorder
them. This function actually emits the "delete_range" signal, and
the default handler of that signal deletes the text. Because the
buffer is modified, all outstanding iterators become invalid after
calling this function; however, the <parameter>start</parameter> and <parameter>end</parameter> will be
re-initialized to point to the location where text was deleted.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> a position in <parameter>buffer</parameter>
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> another position in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-delete-interactive">gtk_text_buffer_delete_interactive ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_delete_interactive
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start_iter,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end_iter,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Deletes all <emphasis>editable</emphasis> text in the given range.
Calls <link linkend="gtk-text-buffer-delete">gtk_text_buffer_delete</link>() for each editable sub-range of
[<parameter>start</parameter>,<parameter>end</parameter>). <parameter>start</parameter> and <parameter>end</parameter> are revalidated to point to
the location of the last deleted range, or left untouched if
no text was deleted.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start_iter</parameter>&nbsp;:</entry>
<entry> start of range to delete
</entry></row>
<row><entry align="right"><parameter>end_iter</parameter>&nbsp;:</entry>
<entry> end of range
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> whether the buffer is editable by default
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether some text was actually deleted
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-set-text">gtk_text_buffer_set_text ()</title>
<programlisting>void        gtk_text_buffer_set_text        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> len);</programlisting>
<para>
Deletes current contents of <parameter>buffer</parameter>, and inserts <parameter>text</parameter> instead. If
<parameter>len</parameter> is -1, <parameter>text</parameter> must be nul-terminated. <parameter>text</parameter> must be valid UTF-8.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>text</parameter>&nbsp;:</entry>
<entry> UTF-8 text to insert
</entry></row>
<row><entry align="right"><parameter>len</parameter>&nbsp;:</entry>
<entry> length of <parameter>text</parameter> in bytes
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-text">gtk_text_buffer_get_text ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gtk_text_buffer_get_text        (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> include_hidden_chars);</programlisting>
<para>
Returns the text in the range [<parameter>start</parameter>,<parameter>end</parameter>). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
<parameter>include_hidden_chars</parameter> is FALSE. Does not include characters
representing embedded images, so byte and character indexes into
the returned string do <emphasis>not</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
<link linkend="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> start of a range
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> end of a range
</entry></row>
<row><entry align="right"><parameter>include_hidden_chars</parameter>&nbsp;:</entry>
<entry> whether to include invisible text
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> an allocated UTF-8 string
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gtk_text_buffer_get_slice       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end,
                                             <link linkend="gboolean">gboolean</link> include_hidden_chars);</programlisting>
<para>
Returns the text in the range [<parameter>start</parameter>,<parameter>end</parameter>). Excludes undisplayed
text (text marked with tags that set the invisibility attribute) if
<parameter>include_hidden_chars</parameter> is FALSE. The returned string includes a
0xFFFC character whenever the buffer contains
embedded images, so byte and character indexes into
the returned string <emphasis>do</emphasis> correspond to byte
and character indexes into the buffer. Contrast with
<link linkend="gtk-text-buffer-get-text">gtk_text_buffer_get_text</link>(). 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 buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> start of a range
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> end of a range
</entry></row>
<row><entry align="right"><parameter>include_hidden_chars</parameter>&nbsp;:</entry>
<entry> whether to include invisible text
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> an allocated UTF-8 string
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-pixbuf">gtk_text_buffer_insert_pixbuf ()</title>
<programlisting>void        gtk_text_buffer_insert_pixbuf   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Inserts an image into the text buffer at <parameter>iter</parameter>. The image will be
counted as one character in character counts, and when obtaining
the buffer contents as a string, will be represented by the Unicode
"object replacement character" 0xFFFC. Note that the "slice"
variants for obtaining portions of the buffer as a string include
this character for pixbufs, but the "text" variants do
not. e.g. see <link linkend="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice</link>() and
<link linkend="gtk-text-buffer-get-text">gtk_text_buffer_get_text</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> location to insert the pixbuf
</entry></row>
<row><entry align="right"><parameter>pixbuf</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkPixbuf">GdkPixbuf</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-insert-child-anchor">gtk_text_buffer_insert_child_anchor ()</title>
<programlisting>void        gtk_text_buffer_insert_child_anchor
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);</programlisting>
<para>
Inserts a child widget anchor into the text buffer at <parameter>iter</parameter>. The
anchor will be counted as one character in character counts, and
when obtaining the buffer contents as a string, will be represented
by the Unicode "object replacement character" 0xFFFC. Note that the
"slice" variants for obtaining portions of the buffer as a string
include this character for child anchors, but the "text" variants do
not. e.g. see <link linkend="gtk-text-buffer-get-slice">gtk_text_buffer_get_slice</link>() and
<link linkend="gtk-text-buffer-get-text">gtk_text_buffer_get_text</link>(). Consider
<link linkend="gtk-text-buffer-create-child-anchor">gtk_text_buffer_create_child_anchor</link>() as a more convenient
alternative to this function. The buffer will add a reference to
the anchor, so you can unref it after insertion.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> location to insert the anchor
</entry></row>
<row><entry align="right"><parameter>anchor</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-create-child-anchor">gtk_text_buffer_create_child_anchor ()</title>
<programlisting><link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link>* gtk_text_buffer_create_child_anchor
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
This is a convenience function which simply creates a child anchor
with <link linkend="gtk-text-child-anchor-new">gtk_text_child_anchor_new</link>() and inserts it into the buffer
with <link linkend="gtk-text-buffer-insert-child-anchor">gtk_text_buffer_insert_child_anchor</link>(). The new anchor is
owned by the buffer; no reference count is returned to
the caller of <link linkend="gtk-text-buffer-create-child-anchor">gtk_text_buffer_create_child_anchor</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> location in the buffer
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the created child anchor
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-create-mark">gtk_text_buffer_create_mark ()</title>
<programlisting><link linkend="GtkTextMark">GtkTextMark</link>* gtk_text_buffer_create_mark    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *mark_name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where,
                                             <link linkend="gboolean">gboolean</link> left_gravity);</programlisting>
<para>
Creates a mark at position <parameter>where</parameter>. If <parameter>mark_name</parameter> is <literal>NULL</literal>, the mark
is anonymous; otherwise, the mark can be retrieved by name using
<link linkend="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark</link>(). If a mark has left gravity, and text is
inserted at the mark's current location, the mark will be moved to
the left of the newly-inserted text. If the mark has right gravity
(<parameter>left_gravity</parameter> = <literal>FALSE</literal>), the mark will end up on the right of
newly-inserted text. The standard left-to-right cursor is a mark
with right gravity (when you type, the cursor stays on the right
side of the text you're typing).
</para>
<para>
The caller of this function does <emphasis>not</emphasis> own a reference
to the returned <link linkend="GtkTextMark">GtkTextMark</link>, so you can ignore the return value
if you like. Marks are owned by the buffer and go away when the
buffer does.
</para>
<para>
Emits the "mark_set" signal as notification of the mark's initial
placement.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>mark_name</parameter>&nbsp;:</entry>
<entry> name for mark, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>where</parameter>&nbsp;:</entry>
<entry> location to place mark
</entry></row>
<row><entry align="right"><parameter>left_gravity</parameter>&nbsp;:</entry>
<entry> whether the mark has left gravity
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the new <link linkend="GtkTextMark">GtkTextMark</link> object
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark ()</title>
<programlisting>void        gtk_text_buffer_move_mark       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Moves <parameter>mark</parameter> to the new location <parameter>where</parameter>. Emits the "mark_set" signal
as notification of the move.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>mark</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextMark">GtkTextMark</link>
</entry></row>
<row><entry align="right"><parameter>where</parameter>&nbsp;:</entry>
<entry> new location for <parameter>mark</parameter> in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-move-mark-by-name">gtk_text_buffer_move_mark_by_name ()</title>
<programlisting>void        gtk_text_buffer_move_mark_by_name
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
Moves the mark named <parameter>name</parameter> (which must exist) to location <parameter>where</parameter>.
See <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark</link>() for details.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of a mark
</entry></row>
<row><entry align="right"><parameter>where</parameter>&nbsp;:</entry>
<entry> new location for mark
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-delete-mark">gtk_text_buffer_delete_mark ()</title>
<programlisting>void        gtk_text_buffer_delete_mark     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark);</programlisting>
<para>
Deletes <parameter>mark</parameter>, so that it's no longer located anywhere in the
buffer. Removes the reference the buffer holds to the mark, so if
you haven't called <link linkend="g-object-ref">g_object_ref</link>() on the mark, it will be freed. Even
if the mark isn't freed, most operations on <parameter>mark</parameter> become
invalid. There is no way to undelete a
mark. <link linkend="gtk-text-mark-get-deleted">gtk_text_mark_get_deleted</link>() will return TRUE after this
function has been called on a mark; <link linkend="gtk-text-mark-get-deleted">gtk_text_mark_get_deleted</link>()
indicates that a mark no longer belongs to a buffer. The "mark_deleted"
signal will be emitted as notification after the mark is deleted.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>mark</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextMark">GtkTextMark</link> in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-delete-mark-by-name">gtk_text_buffer_delete_mark_by_name ()</title>
<programlisting>void        gtk_text_buffer_delete_mark_by_name
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Deletes the mark named <parameter>name</parameter>; the mark must exist. See
<link linkend="gtk-text-buffer-delete-mark">gtk_text_buffer_delete_mark</link>() for details.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of a mark in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark ()</title>
<programlisting><link linkend="GtkTextMark">GtkTextMark</link>* gtk_text_buffer_get_mark       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Returns the mark named <parameter>name</parameter> in buffer <parameter>buffer</parameter>, or NULL if no such
mark exists in the buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> a mark name
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GtkTextMark">GtkTextMark</link>, or NULL
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-insert">gtk_text_buffer_get_insert ()</title>
<programlisting><link linkend="GtkTextMark">GtkTextMark</link>* gtk_text_buffer_get_insert     (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Returns the mark that represents the cursor (insertion point).
Equivalent to calling <link linkend="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark</link>() to get the mark
named "insert", but very slightly more efficient, and involves less
typing.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> insertion point mark
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-selection-bound">gtk_text_buffer_get_selection_bound ()</title>
<programlisting><link linkend="GtkTextMark">GtkTextMark</link>* gtk_text_buffer_get_selection_bound
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Returns the mark that represents the selection bound.  Equivalent
to calling <link linkend="gtk-text-buffer-get-mark">gtk_text_buffer_get_mark</link>() to get the mark named
"selection_bound", but very slightly more efficient, and involves
less typing.
</para>
<para>
The currently-selected text in <parameter>buffer</parameter> is the region between the
"selection_bound" and "insert" marks. If "selection_bound" and
"insert" are in the same place, then there is no current selection.
<link linkend="gtk-text-buffer-get-selection-bounds">gtk_text_buffer_get_selection_bounds</link>() is another convenient function
for handling the selection, if you just want to know whether there's a
selection and what its bounds are.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> selection bound mark
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-place-cursor">gtk_text_buffer_place_cursor ()</title>
<programlisting>void        gtk_text_buffer_place_cursor    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *where);</programlisting>
<para>
This function moves the "insert" and "selection_bound" marks
simultaneously.  If you move them to the same place in two steps
with <link linkend="gtk-text-buffer-move-mark">gtk_text_buffer_move_mark</link>(), you will temporarily select a
region in between their old and new locations, which can be pretty
inefficient since the temporarily-selected region will force stuff
to be recalculated. This function moves them as a unit, which can
be optimized.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>where</parameter>&nbsp;:</entry>
<entry> where to put the cursor
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-apply-tag">gtk_text_buffer_apply_tag ()</title>
<programlisting>void        gtk_text_buffer_apply_tag       (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Emits the "apply_tag" signal on <parameter>buffer</parameter>. The default
handler for the signal applies <parameter>tag</parameter> to the given range.
<parameter>start</parameter> and <parameter>end</parameter> do not have to be in order.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>tag</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextTag">GtkTextTag</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> one bound of range to be tagged
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> other bound of range to be tagged
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-remove-tag">gtk_text_buffer_remove_tag ()</title>
<programlisting>void        gtk_text_buffer_remove_tag      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextTag">GtkTextTag</link> *tag,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Emits the "remove_tag" signal. The default handler for the signal
removes all occurrences of <parameter>tag</parameter> from the given range. <parameter>start</parameter> and
<parameter>end</parameter> don't have to be in order.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>tag</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextTag">GtkTextTag</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> one bound of range to be untagged
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> other bound of range to be untagged
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-apply-tag-by-name">gtk_text_buffer_apply_tag_by_name ()</title>
<programlisting>void        gtk_text_buffer_apply_tag_by_name
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Calls <link linkend="gtk-text-tag-table-lookup">gtk_text_tag_table_lookup</link>() on the buffer's tag table to
get a <link linkend="GtkTextTag">GtkTextTag</link>, then calls <link linkend="gtk-text-buffer-apply-tag">gtk_text_buffer_apply_tag</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of a named <link linkend="GtkTextTag">GtkTextTag</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> one bound of range to be tagged
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> other bound of range to be tagged
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-remove-tag-by-name">gtk_text_buffer_remove_tag_by_name ()</title>
<programlisting>void        gtk_text_buffer_remove_tag_by_name
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *name,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Calls <link linkend="gtk-text-tag-table-lookup">gtk_text_tag_table_lookup</link>() on the buffer's tag table to
get a <link linkend="GtkTextTag">GtkTextTag</link>, then calls <link linkend="gtk-text-buffer-remove-tag">gtk_text_buffer_remove_tag</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of a <link linkend="GtkTextTag">GtkTextTag</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> one bound of range to be untagged
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> other bound of range to be untagged
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-remove-all-tags">gtk_text_buffer_remove_all_tags ()</title>
<programlisting>void        gtk_text_buffer_remove_all_tags (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             const <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Removes all tags in the range between <parameter>start</parameter> and <parameter>end</parameter>.  Be careful
with this function; it could remove tags added in code unrelated to
the code you're currently writing. That is, using this function is
probably a bad idea if you have two or more unrelated code sections
that add tags.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> one bound of range to be untagged
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> other bound of range to be untagged
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-create-tag">gtk_text_buffer_create_tag ()</title>
<programlisting><link linkend="GtkTextTag">GtkTextTag</link>* gtk_text_buffer_create_tag      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             const <link linkend="gchar">gchar</link> *tag_name,
                                             const <link linkend="gchar">gchar</link> *first_property_name,
                                             ...);</programlisting>
<para>
Creates a tag and adds it to the tag table for <parameter>buffer</parameter>.
Equivalent to calling <link linkend="gtk-text-tag-new">gtk_text_tag_new</link>() and then adding the
tag to the buffer's tag table. The returned tag is owned by
the buffer's tag table, so the ref count will be equal to one.
</para>
<para>
If <parameter>tag_name</parameter> is <literal>NULL</literal>, the tag is anonymous.
</para>
<para>
If <parameter>tag_name</parameter> is non-<literal>NULL</literal>, a tag called <parameter>tag_name</parameter> must not already
exist in the tag table for this buffer.
</para>
<para>
The <parameter>first_property_name</parameter> argument and subsequent arguments are a list
of properties to set on the tag, as with <link linkend="g-object-set">g_object_set</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>tag_name</parameter>&nbsp;:</entry>
<entry> name of the new tag, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>first_property_name</parameter>&nbsp;:</entry>
<entry> name of first property to set, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>...</parameter>&nbsp;:</entry>
<entry> <literal>NULL</literal>-terminated list of property names and values
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new tag
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-line-offset">gtk_text_buffer_get_iter_at_line_offset ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_line_offset
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number,
                                             <link linkend="gint">gint</link> char_offset);</programlisting>
<para>
Obtains an iterator pointing to <parameter>char_offset</parameter> within the given
line. The <parameter>char_offset</parameter> must exist, offsets off the end of the line
are not allowed. Note <emphasis>characters</emphasis>, not bytes;
UTF-8 may encode one character as multiple bytes.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
<row><entry align="right"><parameter>line_number</parameter>&nbsp;:</entry>
<entry> line number counting from 0
</entry></row>
<row><entry align="right"><parameter>char_offset</parameter>&nbsp;:</entry>
<entry> char offset from start of line
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-offset">gtk_text_buffer_get_iter_at_offset ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_offset
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> char_offset);</programlisting>
<para>
Initializes <parameter>iter</parameter> to a position <parameter>char_offset</parameter> chars from the start
of the entire buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
<row><entry align="right"><parameter>char_offset</parameter>&nbsp;:</entry>
<entry> char offset from start of buffer, counting from 0
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-line">gtk_text_buffer_get_iter_at_line ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_line
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number);</programlisting>
<para>
Initializes <parameter>iter</parameter> to the start of the given line.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
<row><entry align="right"><parameter>line_number</parameter>&nbsp;:</entry>
<entry> line number counting from 0
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-line-index">gtk_text_buffer_get_iter_at_line_index ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_line_index
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="gint">gint</link> line_number,
                                             <link linkend="gint">gint</link> byte_index);</programlisting>
<para>
Obtains an iterator pointing to <parameter>byte_index</parameter> within the given line.
<parameter>byte_index</parameter> must be the start of a UTF-8 character, and must not be
beyond the end of the line.  Note <emphasis>bytes</emphasis>, not
characters; UTF-8 may encode one character as multiple bytes.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize 
</entry></row>
<row><entry align="right"><parameter>line_number</parameter>&nbsp;:</entry>
<entry> line number counting from 0
</entry></row>
<row><entry align="right"><parameter>byte_index</parameter>&nbsp;:</entry>
<entry> byte index from start of line
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-mark">gtk_text_buffer_get_iter_at_mark ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_mark
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextMark">GtkTextMark</link> *mark);</programlisting>
<para>
Initializes <parameter>iter</parameter> with the current position of <parameter>mark</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
<row><entry align="right"><parameter>mark</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextMark">GtkTextMark</link> in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-iter-at-child-anchor">gtk_text_buffer_get_iter_at_child_anchor ()</title>
<programlisting>void        gtk_text_buffer_get_iter_at_child_anchor
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter,
                                             <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *anchor);</programlisting>
<para>
Obtains the location of <parameter>anchor</parameter> within <parameter>buffer</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> an iterator to be initialized
</entry></row>
<row><entry align="right"><parameter>anchor</parameter>&nbsp;:</entry>
<entry> a child anchor that appears in <parameter>buffer</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-start-iter">gtk_text_buffer_get_start_iter ()</title>
<programlisting>void        gtk_text_buffer_get_start_iter  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
Initialized <parameter>iter</parameter> with the first position in the text buffer. This
is the same as using <link linkend="gtk-text-buffer-get-iter-at-offset">gtk_text_buffer_get_iter_at_offset</link>() to get
the iter at character offset 0.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-end-iter">gtk_text_buffer_get_end_iter ()</title>
<programlisting>void        gtk_text_buffer_get_end_iter    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *iter);</programlisting>
<para>
Initializes <parameter>iter</parameter> with the "end iterator," one past the last valid
character in the text buffer. If dereferenced with
<link linkend="gtk-text-iter-get-char">gtk_text_iter_get_char</link>(), the end iterator has a character value of
0. The entire buffer lies in the range from the first position in
the buffer (call <link linkend="gtk-text-buffer-get-start-iter">gtk_text_buffer_get_start_iter</link>() to get
character position 0) to the end iterator.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>iter</parameter>&nbsp;:</entry>
<entry> iterator to initialize
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-bounds">gtk_text_buffer_get_bounds ()</title>
<programlisting>void        gtk_text_buffer_get_bounds      (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [<parameter>start</parameter>,<parameter>end</parameter>).</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> iterator to initialize with first position in the buffer
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> iterator to initialize with the end iterator
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-modified">gtk_text_buffer_get_modified ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_get_modified    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Indicates whether the buffer has been modified since the last call
to <link linkend="gtk-text-buffer-set-modified">gtk_text_buffer_set_modified</link>() set the modification flag to
<literal>FALSE</literal>. Used for example to enable a "save" function in a text
editor.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if the buffer has been modified
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-set-modified">gtk_text_buffer_set_modified ()</title>
<programlisting>void        gtk_text_buffer_set_modified    (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
Used to keep track of whether the buffer has been modified since the
last time it was saved. Whenever the buffer is saved to disk, call
gtk_text_buffer_set_modified (<parameter>buffer</parameter>, FALSE). When the buffer is modified,
it will automatically toggled on the modified bit again. When the modified
bit flips, the buffer emits a "modified_changed" signal.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>setting</parameter>&nbsp;:</entry>
<entry> modification flag setting
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-delete-selection">gtk_text_buffer_delete_selection ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_delete_selection
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="gboolean">gboolean</link> interactive,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Deletes the range between the "insert" and "selection_bound" marks,
that is, the currently-selected text. If <parameter>interactive</parameter> is <literal>TRUE</literal>,
the editability of the selection will be considered (users can't delete
uneditable text).</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>interactive</parameter>&nbsp;:</entry>
<entry> whether the deletion is caused by user interaction
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> whether the buffer is editable by default
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether there was a non-empty selection to delete
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-paste-clipboard">gtk_text_buffer_paste_clipboard ()</title>
<programlisting>void        gtk_text_buffer_paste_clipboard (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *override_location,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Pastes the contents of a clipboard at the insertion point, or at <parameter>override_location</parameter>.
(Note: pasting is asynchronous, that is, we'll ask for the paste data and
return, and at some point later after the main loop runs, the paste
data will be inserted.)</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>clipboard</parameter>&nbsp;:</entry>
<entry> the <link linkend="GtkClipboard">GtkClipboard</link> to paste from
</entry></row>
<row><entry align="right"><parameter>override_location</parameter>&nbsp;:</entry>
<entry> location to insert pasted text, or <literal>NULL</literal> for at the cursor
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> whether the buffer is editable by default
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-copy-clipboard">gtk_text_buffer_copy_clipboard ()</title>
<programlisting>void        gtk_text_buffer_copy_clipboard  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Copies the currently-selected text to a clipboard.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> 
</entry></row>
<row><entry align="right"><parameter>clipboard</parameter>&nbsp;:</entry>
<entry> the <link linkend="GtkClipboard">GtkClipboard</link> object to copy to.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-cut-clipboard">gtk_text_buffer_cut_clipboard ()</title>
<programlisting>void        gtk_text_buffer_cut_clipboard   (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard,
                                             <link linkend="gboolean">gboolean</link> default_editable);</programlisting>
<para>
Copies the currently-selected text to a clipboard, then deletes
said text if it's editable.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>clipboard</parameter>&nbsp;:</entry>
<entry> the <link linkend="GtkClipboard">GtkClipboard</link> object to cut to.
</entry></row>
<row><entry align="right"><parameter>default_editable</parameter>&nbsp;:</entry>
<entry> default editability of the buffer
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-get-selection-bounds">gtk_text_buffer_get_selection_bounds ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_text_buffer_get_selection_bounds
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *start,
                                             <link linkend="GtkTextIter">GtkTextIter</link> *end);</programlisting>
<para>
Returns <literal>TRUE</literal> if some text is selected; places the bounds
of the selection in <parameter>start</parameter> and <parameter>end</parameter> (if the selection has length 0,
then <parameter>start</parameter> and <parameter>end</parameter> are filled in with the same value).
<parameter>start</parameter> and <parameter>end</parameter> will be in ascending order. If <parameter>start</parameter> and <parameter>end</parameter> are
NULL, then they are not filled in, but the return value still indicates
whether text is selected.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>start</parameter>&nbsp;:</entry>
<entry> iterator to initialize with selection start
</entry></row>
<row><entry align="right"><parameter>end</parameter>&nbsp;:</entry>
<entry> iterator to initialize with selection end
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether the selection has nonzero length
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action ()</title>
<programlisting>void        gtk_text_buffer_begin_user_action
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Called to indicate that the buffer operations between here and a
call to <link linkend="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action</link>() are part of a single
user-visible operation. The operations between
<link linkend="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action</link>() and
<link linkend="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action</link>() can then be grouped when creating
an undo stack. <link linkend="GtkTextBuffer">GtkTextBuffer</link> maintains a count of calls to
<link linkend="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action</link>() that have not been closed with
a call to <link linkend="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action</link>(), and emits the "begin_user_action"
and "end_user_action" signals only for the outermost pair of calls.
This allows you to build user actions from other user actions.
</para>
<para>
The "interactive" buffer mutation functions, such as
<link linkend="gtk-text-buffer-insert-interactive">gtk_text_buffer_insert_interactive</link>(), automatically call begin/end
user action around the buffer operations they perform, so there's
no need to add extra calls if you user action consists solely of a
single call to one of those functions.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-end-user-action">gtk_text_buffer_end_user_action ()</title>
<programlisting>void        gtk_text_buffer_end_user_action (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
Should be paired with a call to <link linkend="gtk-text-buffer-begin-user-action">gtk_text_buffer_begin_user_action</link>().
See that function for a full explanation.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-add-selection-clipboard">gtk_text_buffer_add_selection_clipboard ()</title>
<programlisting>void        gtk_text_buffer_add_selection_clipboard
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Adds <parameter>clipboard</parameter> to the list of clipboards in which the selection contents
of <parameter>buffer</parameter> are available. In most cases, <parameter>clipboard</parameter> will be the <link linkend="GtkClipboard">GtkClipboard</link>
of type <literal>GDK_SELECTION_PRIMARY</literal> for a view of <parameter>buffer</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>clipboard</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkClipboard">GtkClipboard</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-text-buffer-remove-selection-clipboard">gtk_text_buffer_remove_selection_clipboard ()</title>
<programlisting>void        gtk_text_buffer_remove_selection_clipboard
                                            (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer,
                                             <link linkend="GtkClipboard">GtkClipboard</link> *clipboard);</programlisting>
<para>
Removes a <link linkend="GtkClipboard">GtkClipboard</link> added with <link linkend="gtk-text-buffer-add-selection-clipboard">gtk_text_buffer_add_selection_clipboard</link>()</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkTextBuffer">GtkTextBuffer</link>
</entry></row>
<row><entry align="right"><parameter>clipboard</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkClipboard">GtkClipboard</link> added to <parameter>buffer</parameter> by <link linkend="gtk-text-buffer-add-selection-clipboard">gtk_text_buffer_add_selection_clipboard</link>().
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="GtkTextBuffer-apply-tag">The &quot;apply-tag&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextTag">GtkTextTag</link> *arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg3</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-begin-user-action">The &quot;begin-user-action&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-changed">The &quot;changed&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-delete-range">The &quot;delete-range&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-end-user-action">The &quot;end-user-action&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-insert-child-anchor">The &quot;insert-child-anchor&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextChildAnchor">GtkTextChildAnchor</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-insert-pixbuf">The &quot;insert-pixbuf&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GdkPixbuf">GdkPixbuf</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-insert-text">The &quot;insert-text&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="gchar">gchar</link> *arg2,
                                            <link linkend="gint">gint</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg3</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-mark-deleted">The &quot;mark-deleted&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextMark">GtkTextMark</link> *arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-mark-set">The &quot;mark-set&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg1,
                                            <link linkend="GtkTextMark">GtkTextMark</link> *arg2,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-modified-changed">The &quot;modified-changed&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkTextBuffer-remove-tag">The &quot;remove-tag&quot; signal</title>
<programlisting>void        user_function                  (<link linkend="GtkTextBuffer">GtkTextBuffer</link> *textbuffer,
                                            <link linkend="GtkTextTag">GtkTextTag</link> *arg1,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg2,
                                            <link linkend="GtkTextIter">GtkTextIter</link> arg3,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>textbuffer</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg2</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>arg3</parameter>&nbsp;:</entry>
<entry>

</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
</tbody></tgroup></informaltable></refsect2>
</refsect1>


<refsect1>
<title>See Also</title>
<para>
<link linkend="GtkTextView">GtkTextView</link>, <link linkend="GtkTextIter">GtkTextIter</link>, <link linkend="GtkTextMark">GtkTextMark</link>
</para>
</refsect1>

</refentry>
