title: Difficulty understand Tkinter mainloop() in python
body: <p>Okay, so I've got a basic window with an EDIT and VIEW button.  As my code stands, EDIT and VIEW both return a message "this button is useless".  I created these under the class "main_window".  I created another class "edit_window" that I'm hoping to call when the EDIT button is clicked.  Essentially, clicking the edit button should change display the new window with buttons ADD and REMOVE. Here's my code so far...what would be the next logical step?  </p>
  
  <pre><code>from Tkinter import *
  #import the Tkinter module and it's methods
  #create a class for our program
  
  class main_window:
      def __init__(self, master):
          frame = Frame(master)
          frame.pack(padx=15,pady=100)
  
          self.edit = Button(frame, text="EDIT", command=self.edit)
          self.edit.pack(side=LEFT, padx=10, pady=10)
  
          self.view = Button(frame, text="VIEW", command=self.view)
          self.view.pack(side=RIGHT, padx=10, pady=10)
  
      def edit(self):
          print "this button is useless"
  
      def view(self):
          print "this button is useless"
  
  class edit_window:
      def __init__(self, master):
          frame = Frame(master)
          frame.pack(padx=15, pady=100)
  
          self.add = Button(frame, text="ADD", command=self.add)
          self.add.pack()
  
          self.remove = Button(frame, text="REMOVE", command=self.remove)
          self.remove.pack()
  
      def add(self):
          print "this button is useless"
  
      def remove(self):
          print "this button is useless"
  
  
  top = Tk()
  top.geometry("500x500")
  top.title('The Movie Machine')
  #Code that defines the widgets
  
  main = main_window(top)
  
  
  #Then enter the main loop
  top.mainloop()
  </code></pre>