### Struct

# Gtk TextIter

since: 4.0

#### Description [src]

    struct GtkTextIter {
      /* No available fields */
    }

An iterator for the contents of a `GtkTextBuffer`.

You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.

Available since: 4.0

#### Instance methods

###### gtk_text_iter_assign

Assigns the value of `other` to `iter`.

since: 4.0

###### gtk_text_iter_backward_char

Moves backward by one character offset.

since: 4.0

###### gtk_text_iter_backward_chars

Moves `count` characters backward, if possible.

since: 4.0

###### gtk_text_iter_backward_cursor_position

Like `gtk_text_iter_forward_cursor_position()`, but moves backward.

since: 4.0

###### gtk_text_iter_backward_cursor_positions

Moves up to `count` cursor positions.

since: 4.0

###### gtk_text_iter_backward_find_char

Same as `gtk_text_iter_forward_find_char()`, but goes backward from `iter`.

since: 4.0

###### gtk_text_iter_backward_line

Moves `iter` to the start of the previous line.

since: 4.0

###### gtk_text_iter_backward_lines

Moves `count` lines backward, if possible.

since: 4.0

###### gtk_text_iter_backward_search

Same as `gtk_text_iter_forward_search()`, but moves backward.

since: 4.0

###### gtk_text_iter_backward_sentence_start

Moves backward to the previous sentence start.

since: 4.0

###### gtk_text_iter_backward_sentence_starts

Calls `gtk_text_iter_backward_sentence_start()` up to `count` times.

since: 4.0

###### gtk_text_iter_backward_to_tag_toggle

Moves backward to the next toggle (on or off) of the `tag`, or to the next toggle of any tag if `tag` is `NULL`.

since: 4.0

###### gtk_text_iter_backward_visible_cursor_position

Moves `iter` backward to the previous visible cursor position.

since: 4.0

###### gtk_text_iter_backward_visible_cursor_positions

Moves up to `count` visible cursor positions.

since: 4.0

###### gtk_text_iter_backward_visible_line

Moves `iter` to the start of the previous visible line.

since: 4.0

###### gtk_text_iter_backward_visible_lines

Moves `count` visible lines backward, if possible.

since: 4.0

###### gtk_text_iter_backward_visible_word_start

Moves backward to the previous visible word start.

since: 4.0

###### gtk_text_iter_backward_visible_word_starts

Calls `gtk_text_iter_backward_visible_word_start()` up to `count` times.

since: 4.0

###### gtk_text_iter_backward_word_start

Moves backward to the previous word start.

since: 4.0

###### gtk_text_iter_backward_word_starts

Calls `gtk_text_iter_backward_word_start()` up to `count` times.

since: 4.0

###### gtk_text_iter_can_insert

Considering the default editability of the buffer, and tags that affect editability, determines whether text inserted at `iter` would be editable.

since: 4.0

###### gtk_text_iter_compare

A qsort()-style function that returns negative if `lhs` is less than `rhs`, positive if `lhs` is greater than `rhs`, and 0 if they’re equal.

since: 4.0

###### gtk_text_iter_copy

Creates a dynamically-allocated copy of an iterator.

since: 4.0

###### gtk_text_iter_editable

Returns whether the character at `iter` is within an editable region of text.

since: 4.0

###### gtk_text_iter_ends_line

Returns `TRUE` if `iter` points to the start of the paragraph delimiter characters for a line.

since: 4.0

###### gtk_text_iter_ends_sentence

Determines whether `iter` ends a sentence.

since: 4.0

###### gtk_text_iter_ends_tag

Returns `TRUE` if `tag` is toggled off at exactly this point.

since: 4.0

###### gtk_text_iter_ends_word

Determines whether `iter` ends a natural-language word.

since: 4.0

###### gtk_text_iter_equal

Tests whether two iterators are equal, using the fastest possible mechanism.

since: 4.0

###### gtk_text_iter_forward_char

Moves `iter` forward by one character offset.

since: 4.0

###### gtk_text_iter_forward_chars

Moves `count` characters if possible.

since: 4.0

###### gtk_text_iter_forward_cursor_position

Moves `iter` forward by a single cursor position.

since: 4.0

###### gtk_text_iter_forward_cursor_positions

Moves up to `count` cursor positions.

since: 4.0

###### gtk_text_iter_forward_find_char

Advances `iter`, calling `pred` on each character.

since: 4.0

###### gtk_text_iter_forward_line

Moves `iter` to the start of the next line.

since: 4.0

###### gtk_text_iter_forward_lines

Moves `count` lines forward, if possible.

since: 4.0

###### gtk_text_iter_forward_search

Searches forward for `str`.

since: 4.0

###### gtk_text_iter_forward_sentence_end

Moves forward to the next sentence end.

since: 4.0

###### gtk_text_iter_forward_sentence_ends

Calls `gtk_text_iter_forward_sentence_end()` `count` times.

since: 4.0

###### gtk_text_iter_forward_to_end

Moves `iter` forward to the “end iterator”, which points one past the last valid character in the buffer.

since: 4.0

###### gtk_text_iter_forward_to_line_end

Moves the iterator to point to the paragraph delimiter characters.

since: 4.0

###### gtk_text_iter_forward_to_tag_toggle

Moves forward to the next toggle (on or off) of the `tag`, or to the next toggle of any tag if `tag` is `NULL`.

since: 4.0

###### gtk_text_iter_forward_visible_cursor_position

Moves `iter` forward to the next visible cursor position.

since: 4.0

###### gtk_text_iter_forward_visible_cursor_positions

Moves up to `count` visible cursor positions.

since: 4.0

###### gtk_text_iter_forward_visible_line

Moves `iter` to the start of the next visible line.

since: 4.0

###### gtk_text_iter_forward_visible_lines

Moves `count` visible lines forward, if possible.

since: 4.0

###### gtk_text_iter_forward_visible_word_end

Moves forward to the next visible word end.

since: 4.0

###### gtk_text_iter_forward_visible_word_ends

Calls `gtk_text_iter_forward_visible_word_end()` up to `count` times.

since: 4.0

###### gtk_text_iter_forward_word_end

Moves forward to the next word end.

since: 4.0

###### gtk_text_iter_forward_word_ends

Calls `gtk_text_iter_forward_word_end()` up to `count` times.

since: 4.0

###### gtk_text_iter_free

Free an iterator allocated on the heap.

since: 4.0

###### gtk_text_iter_get_buffer

Returns the `GtkTextBuffer` this iterator is associated with.

since: 4.0

###### gtk_text_iter_get_bytes_in_line

Returns the number of bytes in the line containing `iter`, including the paragraph delimiters.

since: 4.0

###### gtk_text_iter_get_char

The Unicode character at this iterator is returned.

since: 4.0

###### gtk_text_iter_get_chars_in_line

Returns the number of characters in the line containing `iter`, including the paragraph delimiters.

since: 4.0

###### gtk_text_iter_get_child_anchor

If the location at `iter` contains a child anchor, the anchor is returned.

since: 4.0

###### gtk_text_iter_get_language

Returns the language in effect at `iter`.

since: 4.0

###### gtk_text_iter_get_line

Returns the line number containing the iterator.

since: 4.0

###### gtk_text_iter_get_line_index

Returns the byte index of the iterator, counting from the start of a newline-terminated line.

since: 4.0

###### gtk_text_iter_get_line_offset

Returns the character offset of the iterator, counting from the start of a newline-terminated line.

since: 4.0

###### gtk_text_iter_get_marks

Returns a list of all `GtkTextMark` at this location.

since: 4.0

###### gtk_text_iter_get_offset

Returns the character offset of an iterator.

since: 4.0

###### gtk_text_iter_get_paintable

If the element at `iter` is a paintable, the paintable is returned.

since: 4.0

###### gtk_text_iter_get_slice

Returns the text in the given range.

since: 4.0

###### gtk_text_iter_get_tags

Returns a list of tags that apply to `iter`, in ascending order of priority.

since: 4.0

###### gtk_text_iter_get_text

Returns text in the given range.

since: 4.0

###### gtk_text_iter_get_toggled_tags

Returns a list of `GtkTextTag` that are toggled on or off at this point.

since: 4.0

###### gtk_text_iter_get_visible_line_index

Returns the number of bytes from the start of the line to the given `iter`, not counting bytes that are invisible due to tags with the “invisible” flag toggled on.

since: 4.0

###### gtk_text_iter_get_visible_line_offset

Returns the offset in characters from the start of the line to the given `iter`, not counting characters that are invisible due to tags with the “invisible” flag toggled on.

since: 4.0

###### gtk_text_iter_get_visible_slice

Returns visible text in the given range.

since: 4.0

###### gtk_text_iter_get_visible_text

Returns visible text in the given range.

since: 4.0

###### gtk_text_iter_has_tag

Returns `TRUE` if `iter` points to a character that is part of a range tagged with `tag`.

since: 4.0

###### gtk_text_iter_in_range

Checks whether `iter` falls in the range [`start`, `end`).

since: 4.0

###### gtk_text_iter_inside_sentence

Determines whether `iter` is inside a sentence (as opposed to in between two sentences, e.g. after a period and before the first letter of the next sentence).

since: 4.0

###### gtk_text_iter_inside_word

Determines whether the character pointed by `iter` is part of a natural-language word (as opposed to say inside some whitespace).

since: 4.0

###### gtk_text_iter_is_cursor_position

Determine if `iter` is at a cursor position.

since: 4.0

###### gtk_text_iter_is_end

Returns `TRUE` if `iter` is the end iterator.

since: 4.0

###### gtk_text_iter_is_start

Returns `TRUE` if `iter` is the first iterator in the buffer.

since: 4.0

###### gtk_text_iter_order

Swaps the value of `first` and `second` if `second` comes before `first` in the buffer.

since: 4.0

###### gtk_text_iter_set_line

Moves iterator `iter` to the start of the line `line_number`.

since: 4.0

###### gtk_text_iter_set_line_index

Same as `gtk_text_iter_set_line_offset()`, but works with a byte index. The given byte index must be at the start of a character, it can’t be in the middle of a UTF-8 encoded character.

since: 4.0

###### gtk_text_iter_set_line_offset

Moves `iter` within a line, to a new character (not byte) offset.

since: 4.0

###### gtk_text_iter_set_offset

Sets `iter` to point to `char_offset`.

since: 4.0

###### gtk_text_iter_set_visible_line_index

Like `gtk_text_iter_set_line_index()`, but the index is in visible bytes, i.e. text with a tag making it invisible is not counted in the index.

since: 4.0

###### gtk_text_iter_set_visible_line_offset

Like `gtk_text_iter_set_line_offset()`, but the offset is in visible characters, i.e. text with a tag making it invisible is not counted in the offset.

since: 4.0

###### gtk_text_iter_starts_line

Returns `TRUE` if `iter` begins a paragraph.

since: 4.0

###### gtk_text_iter_starts_sentence

Determines whether `iter` begins a sentence.

since: 4.0

###### gtk_text_iter_starts_tag

Returns `TRUE` if `tag` is toggled on at exactly this point.

since: 4.0

###### gtk_text_iter_starts_word

Determines whether `iter` begins a natural-language word.

since: 4.0

###### gtk_text_iter_toggles_tag

Gets whether a range with `tag` applied to it begins or ends at `iter`.

since: 4.0