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: Cocoa sheet on Carbon window



On 26.06.2007, at 16:56, Uli Kusterer wrote:
2) Use NSWindow's -initWithWindowRef: to get an NSWindow for the Carbon window. I also had to put a category on NSCarbonWindowFrame that overrides -titlebarRect, -_clearDragMargins and - _resetDragMargins with dummy functions, otherwise I'd get exceptions for unimplemented selectors. Then use NSApplication's - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: to show the sheet.

This gives me a functioning sheet, but the Carbon window thinks it's in a modal session or so, and beeps when I click the title bar (if I hold down the command key, it lets me drag it, though).

I also tried setting the window modality of the sheet to window modal and of the owner to none, but this didn't fix the beeping either. I also tried overriding subclassing NSWindow and overriding worksWhenModal to return YES on the NSWindow that I wrap the Carbon window in, but that just tore the sheet off the window as a regular window again :-(

Okay, a tip from an anonymous Apple employee (Thanks, Eric! ;-) ) provided the solution: if I register a handler for kEventWindowGetClickModality on the owning Carbon window, I can tell it to accept inDrag clicks, and now it essentially works. Thanks for all the help.


Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Cocoa sheet on Carbon window (From: Uli Kusterer <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.