The problem I am having is that when my NSPanel is the key window and I press Cmd-N to create a new document window, the event is not handled correctly and no new document window is created. If the NSPanel is not the key window, the event is handled correctly and I get a new document window.

I am working with NSPanel's in a Carbon based application using the 10.5 SDK. A simple and similar test project can be found at:

http://ericgorr.net/CocoaWithCarbon.zip

However, there is at least one significant difference which allows that test project to work, but my real application to fail.

The real application was originally written in PowerPlant and that isn't going to change for awhile. This means that all of the menu events need to come from WaitNextEvent. For some reason, WaitNextEvent isn't giving me the keyDown event.

I do have a Carbon Event handler attached watching for kEventClassCommand / kEventCommandProcess. When my NSPanel is the key window and I press CMD-N, this event is send and I can set a breakpoint to see what happens. I have confirmed that the return value from the handler is eventNotHandledErr. However, as I step out and back to WaitNextEvent, WaitNextEvent returns false which should mean in this case that someone did handle the event.

I have attempted to set breakpoints throughout the application where I am also looking for kEventClassCommand / kEventCommandProcess or calling WaitNextEvent, but none of these are hit.

It is unclear to me why this is failing, unless there is a bug.


I suppose a workaround could be to convert the carbon event into one of the old EventRecord's and call PowerPlants DispatchEvent function directly.


Any thoughts or comments would be appreciated.

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to