visible_rect = textview.get_visible_rect()
top = textview.get_iter_at_location(visible_rect.x, visible_rect.y)
Gtk: How can I get a part of a file in a textview with scrollbars relating to the full file