Re: refresh window's background/mask
Re: refresh window's background/mask
- Subject: Re: refresh window's background/mask
- From: glenn andreas <email@hidden>
- Date: Sat, 23 Apr 2005 14:29:26 -0500
On Apr 23, 2005, at 12:28 PM, Craig Hunter wrote:
I have a transparent window in my app, and I want to be able to turn
the
transparency on/off with a checkbox. I am able to do that for the most
part. If the window starts out as transparent, I can toggle back and
forth
between transparent and opaque no problem. If the window starts out
opaque,
toggling back and forth between opaque and transparent has no visible
effect
unless I first hide/show the window manually in a transparent state. I
believe it's an issue with the window's mask.
I am calling a window update whenever the mode is changed, which is
definitely required to have any effect. But nothing I have tried
forces the
background/mask to refresh when the window starts out opaque. Any
ideas?
Can you always just start out with the window as not opaque (i.e.,
[window setOpaque: NO]) and then just change the background color
according to what you need (so [window setBackgroundColor: [NSColor
clearColor]] to make it transparent, [window setBackgroundColor:
[NSColor whiteColor]] to make it non-transparent)?
In theory, a non opaque window with a solid (no alpha) background
should appear the same as the opaque window.
You'll also want to call [window invalidateShadow] to make sure the
shadow (if you have one) is correct between those changes as well...
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden