• 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: Scroller position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scroller position


  • Subject: Re: Scroller position
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 24 Jun 2002 22:31:02 +0100

Just in case anyone's interested, I worked it out. I used:

NSRange range;

range.location = 0;
range.length = 0;

// new text loaded into view here

[someTextTextView scrollRangeToVisible:range];

It works!!!!
Thanks neverthless due to those who tried to help.
- Jeremy

On Monday, June 24, 2002, at 07:56 pm, Jeremy Dronfield wrote:

I've looked into both of these possibilities:

On Sunday, June 23, 2002, at 10:53 pm, Bryan Blackburn wrote:

NSTextView's ancestor NSResponder has

- (void)moveToBeginningOfDocument:(id)sender

Let it do the work...


This method moves the selection (if any) or the insertion point to the beginning of the document. I should have mentioned that the TextView in question is non-editable.


On Jun 23, 2002 15:30, Donald Brown stated:
You need to call scrollRectToVisible on the NSTextView (NOT the scroller),
something like

rect = [textView bounds];
[textView scrollRectToVisible:NSMakeRect(0,NSMaxY(rect)-10, 10, 10)];


The problem with this is that [textView bounds] gives me an 'incompatible types' error. I've scoured the documentation, and can't believe that there isn't a simple method along the lines of scrollViewToTop (or Bottom or LineNumber) or something. There must be such a method (i.e. the one ProjectBuilder uses to make your project files open at the scroll position you last left them at - but I bet that uses the insertion point, doesn't it. Rats.) Anyone got any other ideas?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Scroller position (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Init method needed? + Dealloc method needed?
  • Next by Date: Re: math.h and floats.
  • Previous by thread: Re: Scroller position
  • Next by thread: [OT] PC Magazine says Obj-C is dead
  • Index(es):
    • Date
    • Thread