Gtk.TextView.prototype.window_to_buffer_coords

function window_to_buffer_coords(win:Gtk.TextWindowType, window_x:Number, window_y:Number):void {
    // Gjs wrapper for gtk_text_view_window_to_buffer_coords()
}

Converts coordinates on the window identified by win to buffer coordinates, storing the result in (buffer_x,buffer_y).

Note that you can't convert coordinates for a nonexisting window (see Gtk.TextView.prototype.set_border_window_size).

win

a Gtk.TextWindowType except #GTK_TEXT_WINDOW_PRIVATE

window_x

window x coordinate

window_y

window y coordinate