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


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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

You need to login to post a comment.