]> granicus.if.org Git - python/commitdiff
Get READABLE c.s. from _tkinter instead of conditional definition.
authorGuido van Rossum <guido@python.org>
Tue, 5 Aug 1997 02:35:01 +0000 (02:35 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 5 Aug 1997 02:35:01 +0000 (02:35 +0000)
in Tk.destroy(), reset _default_root to None when it is us.

Lib/lib-tk/Tkinter.py
Lib/tkinter/Tkinter.py

index 2c47480cbe565dd1a1cc3236bf32d7442e93ad6b..287c06399c8713b7686fb6dfce8c30bff94b5276 100644 (file)
@@ -12,18 +12,9 @@ import string; _string = string; del string
 TkVersion = _string.atof(_tkinter.TK_VERSION)
 TclVersion = _string.atof(_tkinter.TCL_VERSION)
 
-######################################################################
-# Since the values of file event masks changed from Tk 4.0 to Tk 4.1,
-# they are defined here (and not in Tkconstants):
-######################################################################
-if TkVersion >= 4.1:
-    READABLE = 2
-    WRITABLE = 4
-    EXCEPTION = 8
-else:
-    READABLE = 1
-    WRITABLE = 2
-    EXCEPTION = 4
+READABLE = _tkinter.READABLE
+WRITABLE = _tkinter.WRITABLE
+EXCEPTION = _tkinter.EXCEPTION
     
     
 def _flatten(tuple):
@@ -706,6 +697,9 @@ class Tk(Misc, Wm):
                for c in self.children.values(): c.destroy()
                self.tk.call('destroy', self._w)
                Misc.destroy(self)
+               global _default_root
+               if _default_root is self:
+                       _default_root = None
        def __str__(self):
                return self._w
        def readprofile(self, baseName, className):
index 2c47480cbe565dd1a1cc3236bf32d7442e93ad6b..287c06399c8713b7686fb6dfce8c30bff94b5276 100755 (executable)
@@ -12,18 +12,9 @@ import string; _string = string; del string
 TkVersion = _string.atof(_tkinter.TK_VERSION)
 TclVersion = _string.atof(_tkinter.TCL_VERSION)
 
-######################################################################
-# Since the values of file event masks changed from Tk 4.0 to Tk 4.1,
-# they are defined here (and not in Tkconstants):
-######################################################################
-if TkVersion >= 4.1:
-    READABLE = 2
-    WRITABLE = 4
-    EXCEPTION = 8
-else:
-    READABLE = 1
-    WRITABLE = 2
-    EXCEPTION = 4
+READABLE = _tkinter.READABLE
+WRITABLE = _tkinter.WRITABLE
+EXCEPTION = _tkinter.EXCEPTION
     
     
 def _flatten(tuple):
@@ -706,6 +697,9 @@ class Tk(Misc, Wm):
                for c in self.children.values(): c.destroy()
                self.tk.call('destroy', self._w)
                Misc.destroy(self)
+               global _default_root
+               if _default_root is self:
+                       _default_root = None
        def __str__(self):
                return self._w
        def readprofile(self, baseName, className):