Ruby 之 TkButton 示例

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'tk'

root = TkRoot.new
button = TkButton.new(root) {
  text "Hello, World!"
  command proc { puts "I said, Hello!" }
}
button.pack
Tk.mainloop