Create the main or "root" window : TkButton « Tk « Ruby






Create the main or "root" window


require 'tk'

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

 








Related examples in the same category

1.Add button and label