Re: NSTextView offset of text at top of view
Re: NSTextView offset of text at top of view
- Subject: Re: NSTextView offset of text at top of view
- From: Steve Palmer <email@hidden>
- Date: Sun, 21 Mar 2004 17:00:03 -0800
Unfortunately that doesn't work:
[textView pageDown:self];
NSRect bounds = [textView bounds];
NSRect visible = [textView visibleRect];
NSLog(@"Bounds = %d,%d, Visible = %d,%d", bounds.origin.x,
bounds.origin.y, visible.origin.x, visible.origin.y);
I get (0,0) for both bounds and visibleRect on some long text which has
already scrolled. I probably need to spend more time digging into the
offset functions since there's probably some combination that will get
me what I need.
Thanks.
On Mar 21, 2004, at 4:37 PM, Allan Odgaard wrote:
>
On 22. Mar 2004, at 0:44, Steve Palmer wrote:
>
>
> [...] if the textview is at the last page, I want to detect that so I
>
> can load the textview with another message instead. So specifically I
>
> was looking for something like [NSText visibleRange] but that doesn't
>
> exist.
>
>
I doubt such a method exists -- but maybe you can use visibleRect and
>
compare it to the bounds rect? that would also give you an indication
>
about when you hit the last page.
>
>
>
>
** Cocoa FAQ: <http://www.alastairs-place.net/cocoa/faq.txt> **
_______________________________________________
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.