Re: TextView scrolling/cursor problems



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!

Andreas
-- 
Andreas "daff" Ntaflos 
daff AT dword DOT org
Vienna, Austria 

GPG Fingerprint: 	6234 2E8E 5C81 C6CB E5EC  7E65 397C E2A8 090C A9B4
GPG Public Key ID: 	090CA9B4
GPG Public Key:		http://daffit.meownz.info/publickey/andreas_ntaflos.asc

Attachment: pgpzuhOarRdI1.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]