Only deiconify when iconic.

This commit is contained in:
Guido van Rossum 1999-01-18 15:18:57 +00:00
parent f87240f447
commit 36911a1ca9
2 changed files with 8 additions and 4 deletions

View File

@ -157,8 +157,10 @@ class EditorWindow:
menu.configure(postcommand=self.postwindowsmenu) menu.configure(postcommand=self.postwindowsmenu)
def wakeup(self): def wakeup(self):
self.top.tkraise() if self.top.wm_state() == "iconic":
self.top.wm_deiconify() self.top.wm_deiconify()
else:
self.top.tkraise()
self.text.focus_set() self.text.focus_set()
menu_specs = [ menu_specs = [

View File

@ -49,8 +49,10 @@ class ListedToplevel(Toplevel):
def wakeup(self): def wakeup(self):
try: try:
self.tkraise() if self.wm_state() == "iconic":
self.wm_deiconify() self.wm_deiconify()
else:
self.tkraise()
self.focus_set() self.focus_set()
except TclError: except TclError:
# This can happen when the window menu was torn off. # This can happen when the window menu was torn off.