Posted By

Netzach on 02/16/09


Tagged

fade animation Objective-c


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

Netzach
jamesming
mfazekas
Blaenk
emoseman
obsessivejosh
stationstops
shimdh
nsbuckner


Animate A Fade-Out Of A NSWindow With Objective-C


 / Published in: Objective C
 

  1. - (void)fadeOutWindow:(NSWindow*)window{
  2. float alpha = 1.0;
  3. [window setAlphaValue:alpha];
  4. [window makeKeyAndOrderFront:self];
  5. for (int x = 0; x < 10; x++) {
  6. alpha -= 0.1;
  7. [window setAlphaValue:alpha];
  8. [NSThread sleepForTimeInterval:0.020];
  9. }
  10. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: mfazekas on April 22, 2009

What is the purpose of makeKeyAndOrderFront, why we make it key window, before we fade it out?

You need to login to post a comment.