[Python-checkins] r70223 - in python/trunk: Lib/lib-tk/tkSimpleDialog.py Misc/NEWS

guilherme.polo python-checkins at python.org
Sat Mar 7 03:14:39 CET 2009


Author: guilherme.polo
Date: Sat Mar  7 03:14:38 2009
New Revision: 70223

Log:
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.


Modified:
   python/trunk/Lib/lib-tk/tkSimpleDialog.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/lib-tk/tkSimpleDialog.py
==============================================================================
--- python/trunk/Lib/lib-tk/tkSimpleDialog.py	(original)
+++ python/trunk/Lib/lib-tk/tkSimpleDialog.py	Sat Mar  7 03:14:38 2009
@@ -46,6 +46,7 @@
         '''
         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
@@ -65,8 +66,6 @@
 
         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
@@ -77,8 +76,13 @@
             self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
                                       parent.winfo_rooty()+50))
 
+        self.deiconify() # become visibile 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):

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat Mar  7 03:14:38 2009
@@ -168,6 +168,10 @@
 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.


More information about the Python-checkins mailing list