Re: Line/page scrolling an NSScrollView
Re: Line/page scrolling an NSScrollView
- Subject: Re: Line/page scrolling an NSScrollView
- From: Glen Low <email@hidden>
- Date: Tue, 20 Apr 2004 08:06:11 +0800
Allan:
On 11/04/2004, at 10:55 AM, Allan Odgaard wrote:
On 11. Apr 2004, at 2:09, Glen Low wrote:
You'll need to implement the moveUp:/moveDown: action methods in the
embedded view and have these use scrollRectToVisible: or
scrollToPoint:.
That's what I thought. But consider this: the NSScrollView already
*knows* how to scroll by a line, since it does so when you click on
the up-arrow or down-arrow. How do I use that inbuilt functionality?
Yes, I do catch your drift, but probably scroll line down can be made
simply with:
[self scrollRectToVisible:
NSOffsetRect([self visibleRect],
0, [[self enclosingScrollView] verticalLineScroll]
)];
So any solution involving having the scroll view believe the arrow
gadgets where clicked, is probably more complex.
Great... works like a charm! I didn't realize the verticalLineScroll
and horizontalLineScroll values were actual pixel amounts the view
would be scrolled by.
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
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.