summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuilherme Polo <ggpolo@gmail.com>2009-03-07 02:19:14 (GMT)
committerGuilherme Polo <ggpolo@gmail.com>2009-03-07 02:19:14 (GMT)
commitf45b4cce7f5476d92439c9e93ae4b53f0ccbb2a5 (patch)
tree4c01fe046a2ec242457f51a394b524fb75b4b435 /Lib
parent56f5be5317c2b8ec55fb7cbf82467986b4c5f3ff (diff)
downloadcpython-f45b4cce7f5476d92439c9e93ae4b53f0ccbb2a5.zip
cpython-f45b4cce7f5476d92439c9e93ae4b53f0ccbb2a5.tar.gz
cpython-f45b4cce7f5476d92439c9e93ae4b53f0ccbb2a5.tar.bz2
Merged revisions 70223 via svnmerge from
svn+ssh://pythondev/python/trunk ........ r70223 | guilherme.polo | 2009-03-06 23:14:38 -0300 (Fri, 06 Mar 2009) | 4 lines Fixed issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after it is has been populated and properly configured in order to prevent window flashing. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/tkinter/simpledialog.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py
index 96b8b90..885804b 100644
--- a/Lib/tkinter/simpledialog.py
+++ b/Lib/tkinter/simpledialog.py
@@ -130,6 +130,7 @@ class Dialog(Toplevel):
'''
Toplevel.__init__(self, parent)
+ self.withdraw() # remain invisible for now
# If the master is not viewable, don't
# make the child transient, or else it
# would be opened withdrawn
@@ -149,9 +150,6 @@ class Dialog(Toplevel):
self.buttonbox()
- self.wait_visibility() # window needs to be visible for the grab
- self.grab_set()
-
if not self.initial_focus:
self.initial_focus = self
@@ -161,8 +159,13 @@ class Dialog(Toplevel):
self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
parent.winfo_rooty()+50))
+ self.deiconify() # become visible now
+
self.initial_focus.focus_set()
+ # wait for window to appear on screen before calling grab_set
+ self.wait_visibility()
+ self.grab_set()
self.wait_window(self)
def destroy(self):