# omake6.rb require 'tk' v1 = TkVariable.new t1 = TkText.new t2 = TkEntry.new(nil,'textvariable'=>v1) t3 = TkButton.new(nil, 'text'=>'enter', 'command'=>proc{ t1.insert('end',v1.value+"\n") t2.delete(0,'end') }) t1.pack('side'=>'top') t2.pack('side'=>'left') t3.pack('side'=>'left') t2.bind('Control-Key-q',proc{ exit }) t2.bind(['Control-Key-x','Control-Key-c'],proc{ exit }) t2.bind('Return',proc{ t1.insert('end',v1.value+"\n") t2.delete(0,'end') }) Tk.mainloop