views:

49

answers:

1

I have a basic NSWindow with no decorations (titlebar etc), NSWindow set to not opaque no shadow etc. It sits at the screensaver level (so "topmost" window of application)

contentView is set to a subclassed NSView of mine that says "Loading" achieved by drawing a CIImage.

This entire window is centered in the screen. It's opened when a loading event happens elsewhere. When the load is over, I close the window.

Instead of having it instantly appear and instantly disappear, it'd be cool to have it disappear like Windows 7/aero window closing effect, and appear in the same manner.

To clarify: on close the window would grow in size about 20% and fade to translucent. On open the window would appear about 20% larger than it started and fade in to opaque.

How should I do this? One way is that I could make the NSWindow actually be basesize + 20% and maybe use NSAnimation to animate the view. However this doesn't seem to be a direct "good" way. How could I use CA to handle animating this window in the manner I describe? Also open to alternate solutions

A: 

You can use NSViewAnimation to fade and resize the window. Contrary to its name, it works on windows as well as views.

Note that I have no idea what any effects in Windows 7 look like, since I don't use Windows.

Peter Hosey