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