Package: gtk

Function gtk:text-iter-line-offset

Lambda List

gtk:text-iter-line-offset (iter &key visible)

Syntax

(gtk:text-iter-line-offset iter) => offset
(gtk:text-iter-line-offset iter :visible t) => offset
(setf (gtk:text-iter-line-offset iter) offset)
(setf (gtk:text-iter-line-offset iter :visible t) offset)

Arguments

iter -- a gtk:text-iter instance
offset -- an integer with a character offset relative to the start of the current line of the iterator
visible -- a boolean keyword argument, the default is false

Details

The gtk:text-iter-line-offset function returns the character offset of the iterator, counting from the start of a newline-terminated line. The (setf gtk:text-iter-line-offset) function moves the iterator within a line, to the new character offset. If the visible keyword argument is true, the function does not count characters that are invisible due to tags with the invisible attribute toggled on.

The first character on the line has offset 0. The given character offset must be less than or equal to the number of characters in the line. If equal, the iterator moves to the start of the next line. See the gtk:text-iter-line-index function if you have a byte index rather than a character offset.

Notes

This function combines the *_line_offset() and *_visible_line_offset() functions into one, using the visible keyword argument.
 

See also

2024-7-26