Re: Scroll position of a NSTextView
Re: Scroll position of a NSTextView
- Subject: Re: Scroll position of a NSTextView
- From: Neil Earnshaw <email@hidden>
- Date: Wed, 3 Sep 2003 20:02:06 +0100
Thought this was a simple question to start with...
It looks like a scroll bar doesn't have a position because it
represents a range, not a precise location like an NSSlider does.
You can use -knobProportion to find to out what proportion of the slot
the knob fills.
You can use -rectForPart:NSScrollerKnob and
-rectForPart:NSScrollerKnobSlot to get the rects that the knob and its
slot occupy, then do some maths.
An NSTextView is in an NSClipView is in an NSScrollView. You can use
-superview to get to the scroll view then use -documentVisibleRect to
find out what part of the text is visible.
Hope this helps,
-Neil
Hi everyone,
How can I get the scroll-bar position os a NSTextView?
P.
_______________________________________________
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.
Neil Earnshaw
Consultant Software Engineer
Object Software Engineers Ltd
email@hidden
Tel : 01747 854 852
Mbl : 07870 209 102
_______________________________________________
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.