title: tkinter.simpledialog.Dialog leaves the initiating tkinter.Button depressed
body: <p>I am using Python 3.3 on Windows 7.
  I have a <code>tkinter</code> application where one <code>Button</code> fires up a <code>tkinter.simpledialog.Dialog</code>.
  Like this (this is a complete, runnable example):</p>
  
  <pre><code>import tkinter
  import tkinter.simpledialog
  
  class Mainframe(tkinter.Frame):
      def __init__(self, parent):
          super(Mainframe, self).__init__(parent)
          self.parent = parent
          self.button = tkinter.Button(self, text="Open Dialog")
          open_dialog_op = lambda ev: self.open_dialog(ev)
          self.button.bind("&lt;Button-1&gt;", open_dialog_op)
          self.button.bind("&lt;Return&gt;", open_dialog_op)
          self.button.pack(side=tkinter.LEFT)
  
      def open_dialog(self, event):
          dialog = tkinter.simpledialog.Dialog(self.parent, "My Dialog")
          self.button.config(relief=tkinter.RAISED)  # does not help!
  
  root = tkinter.Tk()
  Mainframe(root).pack()
  root.mainloop()
  </code></pre>
  
  <p>The behavior:</p>
  
  <ul>
  <li>if you focus the <em>"Open Dialog"</em> <code>Button</code> and type <em>RETURN</em>, all works nicely</li>
  <li>if you mouse-click the <code>Button</code>, the dialog appears all fine, <strong>but</strong></li>
  <li>when the dialog closes, the <em>"Open Dialog"</em> <code>Button</code> is shown in
  its depressed (<code>tkinter.SUNKEN</code>, if I'm not mistaken?) state.</li>
  <li>(Interestingly, <em>while</em> the dialog is open, the <code>Button</code> is
  shown normally. 
  The depressed look starts only once the dialog closes.)</li>
  <li>I have tried to repair the problem by simply calling 
  <code>button.config(relief=tkinter.RAISED)</code>, but that does not 
  appear to do anything at all in this case.</li>
  </ul>
  
  <p>(Actually, my full application starts showing the button as depressed
   <em>right after it's clicked</em>, not only once the dialog closes again.
   I find this a lot more logical: 
   The <code>simpledialog</code> local event loop grabs all events because the <code>simpledialog</code>
   is modal; this could include the <code>&lt;ButtonRelease-1&gt;</code> mouse event at the Button?)</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why does this happen? </li>
  <li>Why might the behavior in my full application differ?</li>
  <li>How can I avoid or repair both?</li>
  </ol>