Re: Horizontal-only scrolling
Re: Horizontal-only scrolling
- Subject: Re: Horizontal-only scrolling
- From: j o a r <email@hidden>
- Date: Tue, 20 Nov 2007 09:38:03 -0800
On Nov 20, 2007, at 7:23 AM, Petteri Kamppuri wrote:
-scrollWheel: would be nice, if I could convert the NSEvent to
horizontal scrolling from vertical scrolling, but NSEvent API
doesn't seem to make that possible (maybe by subclassing NSEvent?).
Hej,
Perhaps subclass NSScrollView and implement this type of override:
- (void) scrollWheel:(NSEvent *) event
{
NSPoint scrollPoint = [[self contentView] bounds].origin;
scrollPoint.x += rintf([event deltaY]);
scrollPoint.y += rintf([event deltaX]);
[[self documentView] scrollPoint: scrollPoint];
}
FYI: This is a fantastic guide to NSScrollView:
<http://developer.apple.com/documentation/Cocoa/Conceptual/NSScrollViewGuide/index.html
>
j o a r
_______________________________________________
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