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



I'm trying to integrate some Cocoa windows into my Carbon application. I find that if a floating Carbon window (with the standard event handler) has the key focus and a Cocoa window tries to take the key focus I end up in a confused state where both seem to think they have the focus. I don't see this problem with Carbon document windows, just floating windows so I'm guessing it's a bug. Is there a workaround for this, such as adding an event handler to my floating windows or the WindowRef of my Cocoa windows?

I don't actually know what's happening here, never have had a report of this specific problem before. The Cocoa folks might know more, since they handle the Carbon/Cocoa interaction more than we do.

Upon further research I think there's a Carbon focus bug relating to floating windows. For example, if I'm focused on a text control in a document window and click in a text control in a floating window the floating control gets the focus but the document control remains highlighted and the caret continues to blink. I don't think the document window ever gets a "focus lost" CarbonEvent. When one window is a Cocoa window this seems to really confuse Cocoa (e.g., it loses the ability to backspace).

I'll file a bug once I sort it out. One thing that seems to help is to attach an event handler to the floating window to clear the focus of all other windows when the floater gets the focus.

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: 
 >Key Focus Between Carbon & Cocoa Windows (From: Nick Nallick <email@hidden>)
 >Re: Key Focus Between Carbon & Cocoa Windows (From: Eric Schlegel <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.