#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/tile'

root = TkRoot.new() 

# Thanks to https://www.google.com/search?q=ruby+tk+code+for+onclick+event&rlz=1C5OZZY_en&oq=ruby+tk+code+for+onclick+event&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIGCAIQIRgVMgcIAxAhGJ8F0gEJOTczNWowajE1qAIIsAIB&sourceid=chrome&source=chrome.rb&ie=UTF-8
btn = TkButton.new(root) do
  text "Click Me"
  pack(padx: 15, pady: 15)
end

# Assign the action when clicked
btn.command(proc {
  puts "Button was clicked!"
})

# button = Tk::Tile::TButton.new(root) {text "Hello World"}.grid
Tk.mainloop()
