• 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
Re: How to get cursor on an NSTextView to go to the top...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get cursor on an NSTextView to go to the top...


  • Subject: Re: How to get cursor on an NSTextView to go to the top...
  • From: Finlay Dobbie <email@hidden>
  • Date: Sun, 2 Sep 2001 18:18:26 +0100

[myTextView scrollRangeToVisible:NSMakeRange(0,0)] should work.

See file:///Developer/Documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/
Classes/NSText.html

-- Finlay

On Saturday, September 1, 2001, at 07:40 pm, Lloyd Sargent wrote:

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"
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >How to get cursor on an NSTextView to go to the top... (From: Lloyd Sargent <email@hidden>)

  • Prev by Date: How to get cursor on an NSTextView to go to the top...
  • Next by Date: NSImage with URL - why doesn't it work?
  • Previous by thread: How to get cursor on an NSTextView to go to the top...
  • Next by thread: NSImage with URL - why doesn't it work?
  • Index(es):
    • Date
    • Thread