diff options
author | Guido van Rossum <guido@python.org> | 1997-08-05 02:35:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-05 02:35:01 (GMT) |
commit | d6615ab30c5155b746aaef1565835c962d16bae3 (patch) | |
tree | c215486b1d91a207b30d9ad5e8637638e6399968 | |
parent | 1d529d1ecdb3ec7e8fce97f77fc39ed406b6933f (diff) | |
download | cpython-d6615ab30c5155b746aaef1565835c962d16bae3.zip cpython-d6615ab30c5155b746aaef1565835c962d16bae3.tar.gz cpython-d6615ab30c5155b746aaef1565835c962d16bae3.tar.bz2 |
Get READABLE c.s. from _tkinter instead of conditional definition.
in Tk.destroy(), reset _default_root to None when it is us.
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 18 | ||||
-rwxr-xr-x | Lib/tkinter/Tkinter.py | 18 |
2 files changed, 12 insertions, 24 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 2c47480..287c063 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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): diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 2c47480..287c063 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -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): |