title: How to handle a Button click event
body: <p>I'm just learning Python and I have the base concept down, and already a few command line programs. I'm now learning how to create GUIs with Tkinter. </p>
  
  <p>I created a simple GUI to accept some user information from a <code>Entry</code> widget, and then, when the user clicks submit, it should pop up a dialog.</p>
  
  <p>The dialog should ask for the <em>first name</em> and <em>last name</em>.</p>
  
  <p>The problem is that I don't know how to handle the event when the user clicks submit. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>from Tkinter import *
  
  class GUI(Frame):
  
      def __init__(self,master=None):
          Frame.__init__(self, master)
          self.grid()
  
          self.fnameLabel = Label(master, text="First Name")
          self.fnameLabel.grid()
  
          self.fnameEntry = Entry(master)
          self.fnameEntry.grid()
  
          self.lnameLabel = Label(master, text="Last Name")
          self.lnameLabel.grid()
  
          self.lnameEntry = Entry(master)
          self.lnameEntry.grid()
  
          self.submitButton = Button(self.buttonClick, text="Submit")
          self.submitButton.grid()
  
  
      def buttonClick(self, event):
          """ handle button click event and output text from entry area"""
          pass
  
  
  if __name__ == "__main__":
      guiFrame = GUI()
      guiFrame.mainloop()
  </code></pre>