When a message box is dismissed, focus will be returned to the parent window. By default this is the root window. Typically you will want to set it to the button or toplevel window that caused the message box to appear.
To set the parent, use the parent
attribute when creating the dialog. For example:
...
tkMessageBox.showwarning("Danger, Will Robinson!",
parent=self.destruct_button)
...
See http://effbot.org/tkinterbook/tkinter-standard-dialogs.htm for more information