Skip to content

Commit f45b4cc

Browse files
committed
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 python#2638: Show a window constructed with tkSimpleDialog.Dialog only after it is has been populated and properly configured in order to prevent window flashing. ........
1 parent 56f5be5 commit f45b4cc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Lib/tkinter/simpledialog.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def __init__(self, parent, title = None):
130130
'''
131131
Toplevel.__init__(self, parent)
132132

133+
self.withdraw() # remain invisible for now
133134
# If the master is not viewable, don't
134135
# make the child transient, or else it
135136
# would be opened withdrawn
@@ -149,9 +150,6 @@ def __init__(self, parent, title = None):
149150

150151
self.buttonbox()
151152

152-
self.wait_visibility() # window needs to be visible for the grab
153-
self.grab_set()
154-
155153
if not self.initial_focus:
156154
self.initial_focus = self
157155

@@ -161,8 +159,13 @@ def __init__(self, parent, title = None):
161159
self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
162160
parent.winfo_rooty()+50))
163161

162+
self.deiconify() # become visible now
163+
164164
self.initial_focus.focus_set()
165165

166+
# wait for window to appear on screen before calling grab_set
167+
self.wait_visibility()
168+
self.grab_set()
166169
self.wait_window(self)
167170

168171
def destroy(self):

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ Core and Builtins
183183
Library
184184
-------
185185

186+
- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
187+
it is has been populated and properly configured in order to prevent
188+
window flashing.
189+
186190
- Issue #4792: Prevent a segfault in _tkinter by using the
187191
guaranteed to be safe interp argument given to the PythonCmd in place of
188192
the Tcl interpreter taken from a PythonCmd_ClientData.

0 commit comments

Comments
 (0)