# omake1.rb require 'tk' v1 = TkVariable.new t1 = TkText.new(nil) t2 = TkButton.new(nil, 'text'=>'quit', 'command'=>proc{exit}) t3 = TkEntry.new(nil, 'textvariable'=>v1) t1.pack('side'=>'top') t2.pack('side'=>'left') t3.pack('side'=>'left') t3.bind('Return',proc{ t1.insert('end', v1.value+"\n") t3.delete(0,'end') }) Tk.mainloop