title: python tkinter disable line break in text widget
body: <p>In the code below, I am looking for a way to disable the line break in a Text widget. I would simply have used an Entry widget however, Entry has no UNDO functionality.</p>
  
  <p>When I press enter in the Text widget, the parse function is called as required but it also goes to the next line.</p>
  
  <p>Any help would be appreciated, thanks.</p>
  
  <p>#</p>
  
  <pre><code>from Tkinter import *
  
  class Application(Frame):
      def __init__(self):
          self.master = Tk()
          self.master.geometry("300x200")
  
          Frame.__init__(self, self.master)
          self.create_widgets()
  
      def create_widgets(self):
          self.master.bind('&lt;Return&gt;', self.parse)
          self.grid()
  
          w1 = Text(self, undo=True, height=1, width=26,wrap=NONE)
          w1.grid(row=0, column=1, padx=5, pady=5, sticky=W)
  
          self.submit = Button(self, text="Submit")
          self.submit.bind('&lt;Button-1&gt;', self.parse)
          self.submit.grid(row=0, column=2, sticky=E)
  
      def parse(self, event):
          print("You clicked?")
  
      def start(self):
          self.master.mainloop()
  
  
  Application().start()
  </code></pre>