Re: Determining the scroll position of an NSTextView?
Re: Determining the scroll position of an NSTextView?
- Subject: Re: Determining the scroll position of an NSTextView?
- From: Public Look <email@hidden>
- Date: Sun, 2 Nov 2003 10:23:52 -0500
Here is an exact solution to your problem:
http://cocoa.mamasam.com/MACOSXDEV/2003/04/2/62126.php
Here are a few close solutions chosen at random:
http://cocoa.mamasam.com/COCOADEV/2001/07/1/3617.php
http://cocoa.mamasam.com/COCOADEV/2001/11/2/17895.php
http://cocoa.mamasam.com/COCOADEV/2001/11/1/17764.php
http://cocoa.mamasam.com/COCOADEV/2002/06/2/37603.php
I would add that instead of relying on the vertical scroller position,
you could compare the rectangles returned from -bounds and -visibleRect
and scroll only of the visibleRect includes the maximum extent of the
bounds. I prefer that to checking the vertical scroll position because
this type of scrolling might be desirable even if there is no visible
scroller.
On Nov 2, 2003, at 8:52 AM, Wade Tregaskis wrote:
Forgive me if this is blindingly obvious, but I've been searching the
documentation & archives for a few days now, and haven't turned up
anything obvious on this.
While there is a method to set the position of an NSScrollView (or
NSScroller.. can't remember off hand), there doesn't seem to be any
way of getting the position. Essentially all I want to do is update
the scroll position when new text is added (so that the field scrolls
with the new text), but only if the field is already scrolled all the
way to the bottom. If it's not at the bottom, I'll presume the user
has scrolled up to read something, so I don't want to disturb them.
Anyway, unless there's some configuration which does this
automatically, all I need is a way of determining the scroll position.
Any ideas?
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.