2
votes

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

1
To what purpose? Why are you subclassing NSWindow? Are you actually making a screensaver?mcandre
I'm not subclassing NSWindow, I'm setting it to have no decorations and setting it to a high level so that it's displayed on top of all open windows. That's all working great. I subclassed NSView and set contentView to it so that I can put specialized drawing code there to draw in the NSWindow. This all works. (not a screensaver, I'm making a loading splash screen. The question applies outside of this specific use though)Nektarios

1 Answers

1
votes

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.