Carbon pasteboard/service events not firing in Cocoa app
Carbon pasteboard/service events not firing in Cocoa app
- Subject: Carbon pasteboard/service events not firing in Cocoa app
- From: Kevin Walzer <email@hidden>
- Date: Mon, 19 Apr 2010 10:46:30 -0400
- Organization: WordTech Communications LLC
I'm trying to port some Carbon code that provides basic services menu
integration to a Cocoa application. This code implements the basic
Carbon event handlers for this functionality, cf:
const EventTypeSpec carbonServiceEvents[] = {
{ kEventClassService, kEventServiceGetTypes },
{ kEventClassService, kEventServiceCopy },
{ kEventClassService, kEventServicePaste },
{ kEventClassService, kEventServicePerform }
};
I understand that Cocoa has its own NSServices protocol/API, but these
particular events and the Pasteboard API are still supported and not
deprecated under Cocoa and 64-bit. The basic structure is here:
http://developer.apple.com/carbon/pasteboards.html
The code is mostly working: other applications can send clipboard data
to my app's service, and it will function as expected. However, inside
my application, the kEventServiceCopy event never fires. As a result,
the Services menu is completely grayed out.
I'm not sure how to fix this. In my Carbon application, simply
installing these event handlers made the Services menu available. It's
not clear to me why the kEventServiceCopy event does not fire, but the
kEventServiceGetTypes event (necessary to determine if my app provides a
service) and kEventServicePerform (to perform the service) do fire.
Any advice is appreciated.
--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
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