]> 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:34 +0000 (18:00 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 18 Nov 2006 18:00:34 +0000 (18:00 +0000)
the parent window is withdrawn. This mirrors what dialog.tcl
does.

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 8324a055ac56446ae504fe9ec07d7a49e8aa331c..6e50ed3c7b93303c7df34b65edec8fd098a8d370 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -103,6 +103,9 @@ Extension Modules
 Library
 -------
 
+- Patch #1538878: Don't make tkSimpleDialog dialogs transient if
+  the parent window is withdrawn.
+
 - Patch #1360200: Use unmangled_version RPM spec field to deal with
   file name mangling.