]> granicus.if.org Git - python/commitdiff
Merged revisions 70223 via svnmerge from
authorGuilherme Polo <ggpolo@gmail.com>
Sat, 7 Mar 2009 02:19:14 +0000 (02:19 +0000)
committerGuilherme Polo <ggpolo@gmail.com>
Sat, 7 Mar 2009 02:19:14 +0000 (02:19 +0000)
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.
........

Lib/tkinter/simpledialog.py
Misc/NEWS

index 96b8b90d21518154fc79ff366e9d9df3ea14d8a7..885804b3c703fe74dd65adf0ef79e8128c1f518d 100644 (file)
@@ -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):
index 45bd799804cf625ad32aaf60373957a7627b6f25..48cb004a031a3d7fddbd6a611ba9ecf43f98f5f8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -183,6 +183,10 @@ Core and Builtins
 Library
 -------
 
+- 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.
+
 - Issue #4792: Prevent a segfault in _tkinter by using the
   guaranteed to be safe interp argument given to the PythonCmd in place of
   the Tcl interpreter taken from a PythonCmd_ClientData.