Re: Imitating Behavior of a Sheet Window
Re: Imitating Behavior of a Sheet Window
- Subject: Re: Imitating Behavior of a Sheet Window
- From: Andy Lee <email@hidden>
- Date: Fri, 22 Jan 2010 17:23:56 -0500
On Friday, January 22, 2010, at 04:18PM, "Oleg Krupnov" <email@hidden> wrote:
>Thanks Andy.
>
>Here's more info. The sheet is a semi-transparent nag window with some
>text and a couple of buttons, that overlaps the main window. The sheet
>does not have a shadow, so there is no problem to reproduce it. The
>nag window is automatically resized together with the parent window so
>that the nag always entirely shadows its parent.
To me this sounds exactly like a view that replaces the window's content view.
>What confuses me is that the standard sheet methods are obviously
>merely a convenience for showing the sheet windows, and there must be
>a "manual" way to do it, but I can't find it.
Yeah, you would think so, especially since drawers are also child windows and they behave the way you want. I don't know much about child windows myself, but found this thread on the Omni list -- looks promising:
<http://www.omnigroup.com/mailman/archive/macosx-dev/2005-August/057291.html>
<http://www.cocoabuilder.com/archive/cocoa/144439-non-focused-child-window.html#144439>
>
>The window buttons of the main window are not disabled, they just
>behave like if the window wasn't active, i.e. they appear gray, but
>when you move the mouse over them, they light up. So I don't think
>forcing them to enable will change anything, because they are already
>enabled, aren't they?
>
>Before I switched to using the child window, I tried to use an
>overlapping view, but I found it buggy too and quite clunky. And Cocoa
>docs explicitly discourages using overlapping views.
Depends on the target OS. I neglected to ask whether you need to support versions before Leopard. Leopard added support for overlapping sibling views. This was confirmed more than once by Apple employees on the list. The docs lagged in being updated. If you find they are still out of date you should send feedback to Apple.
In any case, what you described sounds like it doesn't need overlapping views at all. You could swap out the window's entire content view for the nag view. To get the fading in and out, you might have to do some tricks like take a snapshot of the window before you remove the content view.
But maybe the above links will get your child window working.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden