since: 2.6

Declaration [src]

gtk_text_view_get_iter_at_position (
  GtkTextView* text_view,
  GtkTextIter* iter,
  gint* trailing,
  gint x,
  gint y

Description [src]

Retrieves the iterator pointing to the character at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with gtk_text_view_window_to_buffer_coords().

Note that this is different from gtk_text_view_get_iter_at_location(), which returns cursor locations, i.e. positions between characters.

Available since: 2.6



Type: GtkTextIter

A GtkTextIter.

The argument will be set by the function.
The returned data is owned by the instance.

Type: gint*

If non-NULL, location to store 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.

The argument will be set by the function.
The argument can be NULL.

Type: gint

X position, in buffer coordinates.


Type: gint

Y position, in buffer coordinates.

Return value

Type: gboolean

TRUE if the position is over text.