RosettaCodeData/Task/Simple-windowed-application/Ruby/simple-windowed-application-1.rb
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

11 lines
223 B
Ruby

require 'tk'
str = TkVariable.new("no clicks yet")
count = 0
root = TkRoot.new
TkLabel.new(root, "textvariable" => str).pack
TkButton.new(root) do
text "click me"
command {str.value = count += 1}
pack
end
Tk.mainloop