title: How do I correctly pass focus to and from a message box in python 3 in Windows?
body: <p>I am attempting to use a message box in Python 3 with Tkinter to solicit a name for a user.  The following stripped down code produces such a message box and correctly passes the values on close, but the message box pops up behind the main window.  If I move the message box out, type something in as a name, and click OK, the main window is updated but hidden behind every other open window.</p>
  
  <p>A friend tried to replicate the issue on a Mac, but the code behaved as expected.</p>
  
  <p>How do I make the message box show up on top with focus at the beginning, and how do I correctly hand focus to the main window when the message box is closed?</p>
  
  <pre><code>#!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  import tkinter
  import tkinter.simpledialog
  
  root = tkinter.Tk()
  playerNameVar = tkinter.StringVar()
  playerNameVar.set(tkinter.simpledialog.askstring("Name", \
      "Name?",parent=root))
  
  playerLabel = tkinter.Label(root,textvariable = playerNameVar)
  playerLabel.grid()
  
  root.mainloop()
  </code></pre>