Can't receive a scrollWheel message in a PDFView subclass
Can't receive a scrollWheel message in a PDFView subclass
- Subject: Can't receive a scrollWheel message in a PDFView subclass
- From: Nick <email@hidden>
- Date: Wed, 28 Mar 2012 21:53:42 +0200
Hello
Sorry for flooding the list with basic questions, but I really don't
have a big experience with the Cocoa development.
I am delving currently into PDFKit for Mac, trying to display a PDF
document on a window. I also would like to change default behavior of
this control (this is a customized application, that should allow
user draw onto PDF pages, so preserving "natural" PDFView
functionality is not needed, PDF page is rather treated as a canvas
for drawing).
For example, I would like the user to be able to draw a rectangle with
the right mouse button (instead of displaying context menu), or zoom
in/out the document with the scroll wheel, or "pan" the document (that
has been zoomed in) with the left mouse button, just like Mac OS
Preview application does it in its Move mode.
To achieve this, I have subclassed PDFView class, and tried to
redefine mouse methods - specifically -rightMouseDown, and
-scrollWheel.
It appears none of them is ever called.
As I understand, an event hander for NSView descendant is not being
called if the container of this view (for example, another view)
handles the event and doesn't call, for example, [[self nextResponder]
eventHandlerName:theEvent] (but what is the "superview" for PDFView,
besides the Content View?)
How could I still react to the events?
I have been adviced earlier to make my PDFView subclass install Event
Monitors. Is this the only solution to handle these events? There is
no "prettier" way?
Thank you
_______________________________________________
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