We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Posted By

Netzach on 01/17/08


Tagged

textmate cocoa transparency ruby rubycocoa NSWindow Fade-out


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

Netzach


Animate a fade-out of a NSWindow with RubyCocoa


Published in: Ruby 


  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 

You need to login to post a comment.