# list1003.rb

require 'tk'

t1 = TkText.new

x = TkVariable.new

t2 = TkEntry.new(nil,
    'text'=>'message',
    'textvariable'=>x
)


t3 = TkButton.new(nil,
    'text'=>'Enter',
    'command'=>proc{
        t1.insert('end', x.value + "\n")
    }
)

t4 = TkButton.new(nil,
    'text'=>'Quit',
    'command'=>proc{
        exit
    }
)

t1.pack('side'=>'top')
t2.pack('side'=>'left')
t3.pack('side'=>'left')
t4.pack('side'=>'left')

Tk.mainloop