サンプル
コード
require 'tk'
TkLabel.new do
text "伝 令"
font TkFont.new('times 20 bold italic')
width 20
height 2
bd 5
relief "groove"
pack
end
TkLabel.new do
text "Finish!!"
font TkFont.new('times 20 bold italic')
width 20
height 4
bd 5
relief "groove"
pack
end
root = TkRoot.new
btn_OK = TkButton.new(root) do
text "close"
width 10
focus
borderwidth 5
underline 0
state "normal"
cursor "hand2"
font TkFont.new('times 20 bold')
foreground "red"
activebackground "blue"
relief "raised"
command {exit}
pack("side" => "right", "padx"=> "50", "pady"=> "10")
end
Tk.mainloop
実行結果