title: Python GUI code to click a button to open another window breaks
body: <pre><code>from Tkinter import *
  
  class Window(Tk):
      def __init__(self, parent):
          Tk.__init__(self, parent)
          self.parent = parent
          self.initialize()
  
      def initialize(self):
          self.geometry("600x400+30+30")
          wButton = Button(self, text='text', command = self.OnButtonClick())
          wButton.pack()
  
      def OnButtonClick(self):
          top = Toplevel()
          top.title("title")
          top.geometry("300x150+30+30")
          topButton = Button(top, text="CLOSE", command = self.destroy)
          topButton.pack()
  
  
  if __name__ == "__main__":
      window = Window(None)
  
      window.title("title")
  
      window.mainloop()
  
  #        top.lift(aboveThis=self)
    #self.configure(state=DISABLED) - unknown option "-state"
    #ss = self.state()
    #self["state"] = "disabled" - unknown option "-state"
  #ws = window.state()  # &gt;&gt;&gt; ws outputs: 'normal'
    # varname.unbind("&lt;Button-1&gt;", OnButtonClick)
    #self.unbind("&lt;Button-1&gt;", OnButtonClick)
    #window.unbind("&lt;Button-1&gt;")
  ###if window.OnButtonClick == True:
  ###    window.unbind("&lt;Button-1&gt;", OnButtonClick)
  </code></pre>
  
  <p>The Python ver2.7.3 code above, when ran in IDLE ver2.7.3, using
  Tkver8.5:  displays the smaller top=Toplevel() window first for a
  second, before displaying one instance of the window=Window(Tk) above
  it.  This is before any buttons are clicked or anything.
  <br><br>
  All of the comments underneath the above code are just notes to myself of things that I've tried and ideas to try next (idk - maybe unhelpful stuff).
  <br><br>
  How do I change the above code to:  Make the instance of window=Window(Tk) the parent window and the the top=Toplevel() window the child.  Then, when I run the program, only the parent window should display;  and then when I click on 'wButton', the child window should appear on top of the parent window, with the parent window being disabled - its button inoperable and the user unable to make the window lift to the forefront by clicking on it?</p>