How to scroll to a specific line
- From: John Coppens <john jcoppens com>
- To: gtk-app-devel-list gnome org
- Subject: How to scroll to a specific line
- Date: Thu, 26 Jul 2018 15:17:33 -0300
Hi all...
I've been looking at many posts and articles from all over Google, didn't find
any solution that works.
I'm using Gtk-3, introspection, and Python 3. I've tried many combinations of
get_iter_at_line, place_cursor, place_cursor_onscreen, and others. Even tried to
more or less calculate the scroll position and manipulate the vadjustments.
An example:
itr = self.tbff.get_iter_at_line(linenr)
self.tbff.place_cursor(itr)
self.tview.place_cursor_onscreen()
I suspect that the problem may come from the fact that the widget has not
been rendered yet. I also tried to defer the actual scroll to GLib.idle_add,
but that didn't work out either.
Can anyone point me in the right direction?
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]