Getting called back when an NSScrollView is scrolled
Getting called back when an NSScrollView is scrolled
- Subject: Getting called back when an NSScrollView is scrolled
- From: John Stiles <email@hidden>
- Date: Mon, 28 Jan 2008 09:33:01 -0800
I'd like to get a message sent to my app whenever the user scrolls a
particular NSScrollView around.
There's a method which is close to what I want:
- (void)reflectScrolledClipView:(NSClipView *)aClipView
But according to the docs, this can sometimes get called in cases where
the user didn't actually scroll (e.g. the view was resized or
something). I need to know that it was a user-initiated scrolling action.
In the past, I cheated and made an NSTimer which polled the scroll bar
position, but I'm thinking there's got to be a cleaner way than that.
I am wondering if it would be safe to change the target and action on
the NSScrollView's scrollers to point to a custom selector of mine
(which would call through to the original action before doing my extra
work). Technically this is fraught with peril because the NSScrollView
could change the target/action back at any time, but I am thinking that
pragmatically this is unlikely to actually occur.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden