• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Horizontal-only scrolling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Horizontal-only scrolling (From: Petteri Kamppuri <email@hidden>)

  • Prev by Date: Re: [Solution] backgroundFilters on layer backed views?
  • Next by Date: Re: IS-A relationships in core data
  • Previous by thread: Horizontal-only scrolling
  • Next by thread: [NSTableView] option + click change of behavior between Tiger and Leopard
  • Index(es):
    • Date
    • Thread