Animate a fade-out of a NSWindow with RubyCocoa


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # Animates the window fade-out in 0.5 second.
  2. def fadeOutWindow(windowOutlet)
  3. x = 0
  4. while x < 10
  5. windowOutlet.setAlphaValue(windowOutlet.alphaValue - 0.1)
  6. x += 1
  7. sleep(0.05)
  8. end
  9. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.