• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to get cursor on an NSTextView to go to the top...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Fri, 31 Aug 2001 18:47:32 -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"


  • Prev by Date: Network programming
  • Next by Date: Checksum of App/NIB
  • Previous by thread: Network programming
  • Next by thread: Checksum of App/NIB
  • Index(es):
    • Date
    • Thread