Re: Custom Shadow on an NSWindow
Re: Custom Shadow on an NSWindow
- Subject: Re: Custom Shadow on an NSWindow
- From: Uli Kusterer <email@hidden>
- Date: Mon, 19 Feb 2007 10:08:08 +0100
Am 18.02.2007 um 19:30 schrieb Drarok Ithaqua:
Hi list, I'm looking to drop a custom shadow on my window, but I'm
totally stuck.
Give us less detail, we're all psychic and need the exercise ;-)
*how* custom? What kind of a window is it? If this is a completely
custom window, you can draw your own shadow using NSShadow and
drawing into a borderless window. If this is a standard window with a
titlebar, I guess all you can do is turn off the shadow using the
appropriate NSWindow method.
Sometimes you may have to tell the window its shape changed
explicitly so it'll redo its shadow (the shadow is based on the
window's opaque region). I think the call is named -reshapeWindow or
something like that.
I am assuming that NSShadow is used for this, but I guess this may
not be the case.
NSShadow can be used to draw a shadow instead of any drawing. So,
if you draw your stuff into an NSImage, you can draw it once with an
NSShadow (to get the shadow), and draw your actual drawings on top
afterwards. But note that NSShadow only does shadows that fall off to
two sides. Standard window shadows fall off to the left *and* right,
which I haven't been able to reproduce using NSShadow.
Then again, it's not as if I had tried very hard.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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