Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to REALLY turn off scrolling in a WebView



> You can subclass the NSWindow which the WebView is in and then override the
> sendEvent: method.  In the subclass of the NSWindow, your code should be
> something similar to the following:
> 
> - (void)sendEvent:(NSEvent *)theEvent
> { 
> if ([theEvent type] != NSScrollWheel)
> [super sendEvent:theEvent];
> }
> 
> Therefore, any event from a scrollwheel should not be passed onto the WebView.


Thanks for the suggestion -- that will get me started.  What I would really
like to do is allow the scrollwheel to act on other elements in the window,
but not on the WebView.  And to further complicate it, I only want to
disable scrolling when a certain URL has been loaded in the WebView.  What I
have done up to now is look at the URL in a "didFinishLoadForFrame" handler
under my frameLoadDelegate, and if the URL contains some magic unique text,
call "setAllowsScrolling:NO".

I guess I can do a similar check and decide whether or not to block
NSScrollWheel events from the WebView if there is a suitable WebView
delegate that would be inline with mouse events like this....

Craig

-- 
Dr. Craig Hunter
NASA Langley Research Center
Configuration Aerodynamics Branch
email@hidden
(757) 864-3020


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: How to REALLY turn off scrolling in a WebView (From: haym37 <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.