• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: refresh window's background/mask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: refresh window's background/mask
      • From: Craig Hunter <email@hidden>
References: 
 >refresh window's background/mask (From: Craig Hunter <email@hidden>)

  • Prev by Date: Cocoa Apps on Windows was: Re: Java vs. Objective-C for Cocoa
  • Next by Date: Re: Auto Save - location
  • Previous by thread: refresh window's background/mask
  • Next by thread: Re: refresh window's background/mask
  • Index(es):
    • Date
    • Thread