• 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: 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"


  • Follow-Ups:
    • Re: How to get cursor on an NSTextView to go to the top...
      • From: Finlay Dobbie <email@hidden>
  • Prev by Date: Re: Another controversial question
  • Next by Date: Re: How to get cursor on an NSTextView to go to the top...
  • Previous by thread: Re: Another controversial question
  • Next by thread: Re: How to get cursor on an NSTextView to go to the top...
  • Index(es):
    • Date
    • Thread