Re: TextView scrolling/cursor problems
- From: Paul Davis <pjdavis engineering uiowa edu>
- To: gtkmm list <gtkmm-list gnome org>
- Subject: Re: TextView scrolling/cursor problems
- Date: Tue, 09 May 2006 19:43:29 -0500
Andreas Ntaflos wrote:
On Wednesday 10 May 2006 01:57, Paul Davis wrote:
Try:
// Insert text and save iterator (although not used anymore?)
iter = textviewBuffer->insert(textviewBuffer->end(), "Text portion
with many lines");
// Get current mark at insert position
cur_mark = textviewBuffer->get_insert();
// Scroll to mark
textview->scroll_to(cur_mark, 0.0);
Paul,
thank you very much for your reply and suggestion! Works great and is
certainly the cleaner solution.
I still have the problem that when clicking anywhere in the TextView
cur_mark gets set to that position and scroll_to() always scrolls
there, even when I use the scrollbar to scoll down all the way. Now I
get it that get_insert() always returns the position of the cursor but
how to set the cursor to the end of the TextBuffer (short of clicking
right after the last character in the View)? I can't seem to find a
method that does this in the class reference pages.
Thanks again for your reply!
Tried:
iter = textviewBuffer->insert(textviewBuffer->end(), "" );
cur_mark = textviewBuffer->get_insert();
textview->scroll_to(cur_mark, 0.0);
?
Paul
Andreas
------------------------------------------------------------------------
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]