I sent this reply to Ken but neglected to send it to the list.

On May 26, 2009, at 12:52 AM, Ken Tozier wrote:

'm getting a warning when calling NSEvent's eventWithEventRef

NSEvent *event  = [NSEvent eventWithEventRef: ref];

I include Appkit and Carbon in the file where this warning appears

#import <AppKit/AppKit.h>
#import <Carbon/Carbon.h>

And the documentation doesn't say this is an obsolete method

That method was introduced in Leopard to enable you to augment what you can do with the NSEvent API by getting the CGEventRef opaque object that lies behind the NSEvent object. Once you have the CGEventRef object, you can use the Quartz Event Taps API to do things that aren't available in NSEvent. Event taps are documented in Apple's "Quartz Event Taps Reference" document. Download my free Event Taps Testbench application at prefabsoftware.com/eventtapstestbench for more information.

To answer your question, add this line to your code file:

#import <CoreGraphics/CoreGraphics.h>

I forget whether you have to link to Carbon, but I don't think so -- unless you need it for some other reason.

--

Bill Cheeseman
b...@cheeseman.name
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to