[pygtk] Scroll Region on Screen

Robert Schroll rschroll at gmail.com
Sun Nov 7 05:45:23 WST 2010


Hello all,

I have a TextBuffer in a TextView.  I want to scroll the TextView so 
that two TextMarks, A and B, are both visible.  If the TextView cannot 
fit both on screen together, I wish that A and as much of the text 
between A and B be visible.  I think I should be able to accomplish this 
with:
	TextView.scroll_mark_onscreen(B)
	TextView.scroll_mark_onscreen(A)
But this usually doesn't work.  Instead, it acts as if only the second 
scroll_mark_onscreen had been called: A is onscreen, but B may not be. 
(The one time it seems to work is when I call this code twice without 
changing the contents of the TextBuffer in between.)  There's not a 
problem with TextMark B: if I comment out the last line, B gets scrolled 
on screen just like I want.  And if I invert the order of the 
statements, I get the opposite behavior.

Can anyone provide some insight into what's going wrong, or offer a 
different solution for getting both marks on screen?

Thanks,
Robert


More information about the pygtk mailing list