Created
December 7, 2010 21:45
-
-
Save nazgob/732475 to your computer and use it in GitHub Desktop.
timer in ruby shoes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shoes.app :height => 150, :width => 250 do | |
background rgb(240, 250, 208) | |
stack :margin => 10 do | |
button "Start" do | |
@time = Time.now | |
@label.replace "Stop watch started at #@time" | |
end | |
button "Stop" do | |
@label.replace "Stopped, ", strong("#{Time.now - @time}"), " seconds elapsed." | |
end | |
@label = para "Press ", strong("start"), " to begin timing." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment