]> granicus.if.org Git - python/commitdiff
Patch #1538878: Don't make tkSimpleDialog dialogs transient if
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Nov 2006 18:00:23 +0000 (18:00 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Nov 2006 18:00:23 +0000 (18:00 +0000)
the parent window is withdrawn. This mirrors what dialog.tcl
does.
Will backport to 2.5.

Lib/lib-tk/tkSimpleDialog.py
Misc/NEWS

index 4d11ce0209481f57e1e9c20aa5094e9e0037a085..02ea034b339290f1ddd84bc84124fa9bd659d0f7 100644 (file)
@@ -46,8 +46,13 @@ class Dialog(Toplevel):
             title -- the dialog title
         '''
         Toplevel.__init__(self, parent)
-        self.transient(parent)
 
+        # If the master is not viewable, don't
+        # make the child transient, or else it
+        # would be opened withdrawn
+        if parent.winfo_viewable():  
+            self.transient(parent)
         if title:
             self.title(title)
 
index 8c9351992d9572930e647ecd9c21137ed6986fe3..42f0b93b7fa58b30d1b0286df3392c3adbab3ee3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -98,6 +98,9 @@ Core and builtins
 Library
 -------
 
+- Patch #1538878: Don't make tkSimpleDialog dialogs transient if
+  the parent window is withdrawn.
+
 - Bug #1597824: return the registered function from atexit.register()
   to facilitate usage as a decorator.