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: catch that mouseDown?



Michael, thanks for that reply.

The thing is that in the QC Programming Guide (http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/index.html), it is mentioned that "To forward user events, such as mouse clicks, from the view to the composition, click Forward All Events. If you forward events, QCView accepts First Responder status. Events must be forwarded for compositions that can respond to user input. For example, if the position of an object depends on the location of the mouse, you need to forward events." 
This text seems to suggest that by leaving the "Forward all events" checkbox unchecked, user events will not be forwarded to the composition. With that checkbox checked or unchecked, a subclassed QCView with a -(void)mouseDown:(NSEvent*)theEvent; inserted doesn't respond to a mouseDown. In that case, where can I catch these events, in order to do some processing on the mouse coordinates (too much for a Math-patch or JS), and forward the results to the composition by KVC?

I may have to let go of QCView, and fall back on NSView & QCRenderer. Anyway, I put the question to the list, just so that more experienced developers can point out where I go wrong.

Best regards,
William

On Feb 12, 2006, at 2:07 PM, michael markert wrote:

Hi William,

The error somewhere here:

the checkbox "Forward all events" is unchecked


Normally you would proceed as followed:

1. create a subclass of "NSView" and add the NSResponder "-(void)mouseDown:(NSEvent*)theEvent"
2. open mainMenu.nib and drag a "NSView" into a NSWindow
3. go to the inspector tab "custom Class" and select your "MYQCView" instead of "NSView"
4. compile and go... should work!

Best regards,
Michael




Am 12.02.2006 um 11:46 schrieb william van braam:

Beginners question.

I would like to catch the mouseDowns programatically, not in the composition. So in IB I drop a (subclassed QCView) MyQCView on a window and add its corresponding QCController. For MyQCView the checkbox "Forward all events" is unchecked. Run it and click on the MyQCView. The - (void)mouseDown(NSEvent *)e {NSLog@"...";} in MyQCView.m doesn't react.
So, where to catch the mouseDowns?

I must be missing something very basic; a pointer would be appreciated.
(QC2.1.1, XCode2.1.1, iBookG4, Tiger)

Thanks,
William

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

This email sent to email@hidden

References: 
 >catch that mouseDown? (From: william van braam <email@hidden>)
 >Re: catch that mouseDown? (From: michael markert <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.