Package: gtk

Function gtk-text-view-iter-at-position

Lambda List

gtk-text-view-iter-at-position (view x y)

Arguments

view -- a gtk-text-view widget
x -- an integer with the x position, in text buffer coordinates
y -- an integer with the y position, in text buffer coordinates

Return Value

iter -- a gtk-text-iter iterator
trailing -- if non-nil, an integer indicating where in the grapheme the user clicked, it will either be zero, or the number of characters in the grapheme, 0 represents the trailing edge of the grapheme

Details

Retrieves the iterator pointing to the character at text buffer coordinates x and y. Text buffer coordinates are coordinates for the entire text buffer, not just the currently displayed portion. If you have coordinates from an event, you have to convert those to text buffer coordinates with the gtk-text-view-window-to-buffer-coords function.

Note that this is different from the gtk-text-view-iter-at-location function, which returns cursor locations, i.e. positions between characters.
 

See also

2021-10-16