How to get cursor on an NSTextView to go to the top...
How to get cursor on an NSTextView to go to the top...
- Subject: How to get cursor on an NSTextView to go to the top...
- From: Lloyd Sargent <email@hidden>
- Date: Sat, 1 Sep 2001 13:40:26 -0500
I'm inserting text in an NSTextView via the following:
[myTextView insertText:myTextString];
Works fine, tastes great, except if the text string is larger than the
window it scrolls to the bottom. Well, I would like to programatically
move it to the top. I tried the following (based on someone's need to
move the cursor to the bottom):
[myTextView setSelectedRange:NSMakeRange(0, 0)];
Well that didn't work so I wondered if the index was supposed to be one
and tried the following:
[myTextView setSelectedRange:NSMakeRange(1, 0)];
No, go. What it did was select the text, BUT didn't move the cursor at
all i.e. the scroll-bar was at the bottom of my textview.
Okay, so HOW do I REALLY do this?
Cheers,
Lloyd
--------
Canna Software Development
"No llamas were frustrated by the NSTextView in the creation of this
e-mail"