11.115Class GtkTextIter

Text buffer iterator

Class GtkTextIter( [table] )
table (GtkTextTable) a tag table, or nil to create a new one.

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.

Methods
copyCreates a copy of an iterator.
get_charReturns the Unicode character at this iterator.
get_lineReturns the line number containing the iterator.
get_line_indexReturns the byte index of the iterator, counting from the start of a newline-terminated line.
get_line_offsetReturns the character offset of the iterator, counting from the start of a newline-terminated line.
get_offsetReturns the character offset of an iterator.
get_pixbufIf the element at iter is a pixbuf, the pixbuf is returned. Otherwise, nil is returned.
get_sliceReturns the text in the given range.
get_textReturns text in the given range.
get_visible_line_indexReturns 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.
get_visible_line_offsetReturns 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.
get_visible_sliceLike get_slice(), but invisible text is not included.
get_visible_textLike gtk_text_iter_get_text(), but invisible text is not included.

Methods

copy

Creates a copy of an iterator.

GtkTextIter.copy()
Returna copy of GtkTextIter

get_char

Returns the Unicode character at this iterator.

GtkTextIter.get_char()
Returna Unicode character, or nil if iter is not dereferenceable (Equivalent to operator* on a C++ iterator.) If the element at this iterator is a non-character element, such as an image embedded in the buffer, the Unicode "unknown" character 0xFFFC is returned. If invoked on the end iterator, zero is returned; zero is not a valid Unicode character. So you can write a loop which ends when gtk_text_iter_get_char() returns 0.

get_line

Returns the line number containing the iterator.

GtkTextIter.get_line()
Returna line number

Lines in a GtkTextBuffer are numbered beginning with 0 for the first line in the buffer.

get_line_index

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

GtkTextIter.get_line_index()
Returndistance from start of line, in bytes

Remember that GtkTextBuffer encodes text in UTF-8, and that characters can require a variable number of bytes to represent.

get_line_offset

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

GtkTextIter.get_line_offset()
Returnoffset from start of line

The first character on the line has offset 0.

get_offset

Returns the character offset of an iterator.

GtkTextIter.get_offset()
Returna character offset

Each character in a GtkTextBuffer has an offset, starting with 0 for the first character in the buffer. Use gtk_text_buffer_get_iter_at_offset() to convert an offset back into an iterator.

get_pixbuf

If the element at iter is a pixbuf, the pixbuf is returned. Otherwise, nil is returned.

GtkTextIter.get_pixbuf()
Returnthe pixbuf

get_slice

Returns the text in the given range.

GtkTextIter.get_slice( end )
end iterator at end of a range
Returnslice of text from the buffer

A "slice" is an array of characters encoded in UTF-8 format, including the Unicode "unknown" character 0xFFFC for iterable non-character elements in the buffer, such as images. Because images are encoded in the slice, byte and character offsets in the returned array will correspond to byte offsets in the text buffer. 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.

get_text

Returns text in the given range.

GtkTextIter.get_text( end )
end iterator at end of a range
Returnarray of characters from the buffer

If the range contains non-text elements such as images, the character and byte offsets in the returned string will not correspond to character and byte offsets in the buffer. If you want offsets to correspond, see gtk_text_iter_get_slice().

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.

GtkTextIter.get_visible_line_index()
Returnbyte index of iter with respect to the start of the line

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.

GtkTextIter.get_visible_line_offset()
Returnoffset in visible characters from the start of the line

get_visible_slice

Like get_slice(), but invisible text is not included.

GtkTextIter.get_visible_slice( end )
end iterator at end of a range
Returnslice of text from the buffer

Invisible text is usually invisible because a GtkTextTag with the "invisible" attribute turned on has been applied to it.

get_visible_text

Like gtk_text_iter_get_text(), but invisible text is not included.

GtkTextIter.get_visible_text( end )
end iterator at end of a range
Returnstring containing visible text in the range

Invisible text is usually invisible because a GtkTextTag with the "invisible" attribute turned on has been applied to it.

Made with http://www.falconpl.org