Re: Scroller position
Re: Scroller position
- Subject: Re: Scroller position
- From: Donald Brown <email@hidden>
- Date: Sun, 23 Jun 2002 15:30:27 -0500
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)];
Alternatively, you could call scrollPoint, but you would have to figure out
the lower-left corner of the area you want visible.
Donald
on 6/23/02 3:18 PM, Jeremy Dronfield at email@hidden wrote:
>
I'm not actually removing anything but the text. It's in a NSTextView in
>
a non-document-based application. Isn't there any way to do it without
>
removing any View objects?
>
- Jeremy.
>
>
On Sunday, June 23, 2002, at 08:33 pm, Jason Harris wrote:
>
>
> I just ran into this problem. Before you remove the original
>
> documentView
>
> from the NSScrollView and replace it with the new view, do
>
> [originalDocumentView setFrame: NSZeroRect];
>
> [scrollView setDocumentView: nil];
>
>
>
> Jason Harris
>
>
>
>
>
> Jeremy Dronfield Tried to Tell Me:
>
>
>
>> I'm trying to manipulate the scroll position of an NSTextView. When a
>
>> new .rtf file loads into the View, replacing the previous contents (I'm
>
>> using the same view here, rather than separate documents), I want the
>
>> View to snap back to the top, regardless of where it was scrolled to
>
>> when the user finished reading the first text file. I don't seem to be
>
>> able to access NSScroller's setFloatValue method - NSScrollView doesn't
>
>> respond to it. Do I need to create a new TextView instance just to get
>
>> this effect? I need the equivalent of REALbasic's
>
>> "Field.ScrollPosition =" (It must be in the API somewhere, for
>
>> REALbasic
>
>> to access it).
>
>>
>
>> - Jeremy
>
>> _______________________________________________
>
>> 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.
>
_______________________________________________
>
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.
--
Donald Brown
email@hidden
http://www.eamontales.com
We have met the enemy and he is us - Pogo
_______________________________________________
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.