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: Key Focus Between Carbon & Cocoa Windows



Kristin,

On Nov 5, 2003, at 12:58 PM, Kristin Webster wrote:

I have a similar report of a problem in Cocoa apps with focus issues between Carbon floating windows and Cocoa windows. I'll investigate to see if both these problems have the same root cause. Is your workaround of attaching an event handler to the floating window acceptable for now?

My most recent observations (rdar://3472720) are that if a floating Carbon window has the key focus and the user clicks in a Cocoa text field something in the window glue gets confused. No CarbonEvents are sent and the Carbon field doesn't seem to know it's lost the focus. The Cocoa field seems to process most keystrokes (other than backspace) but it doesn't seem to set up a proper Autorelease pool (lots of console messages to this effect during typing).

Is your workaround of attaching an event handler to the floating window acceptable for now?

If attaching a CarbonEvent handler would workaround the problem I'd be happy but this doesn't seem possible because I can't find any events being sent in this circumstance. My current thinking is that my best bet is to attach some kind of controller object to the Cocoa window which would callback to me before the Cocoa window acquires the focus so I can remove the focus from any Carbon floaters first. Unfortunately I don't know enough low-level Cocoa to pull this off yet.

FWIW, some of this can also be seen when using the Carbon Font Panel with a floating Carbon window but the behavior seems to be somewhat different (e.g., I haven't seen the Autorelease pool problem).

If you determine a workaround please let me know. If you need any sample code or an app I'd be happy to provide what I can.

Thanks,
Nick
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Key Focus Between Carbon & Cocoa Windows (From: Kristin Webster <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.