mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Get READABLE c.s. from _tkinter instead of conditional definition.
in Tk.destroy(), reset _default_root to None when it is us.
This commit is contained in:
parent
1d529d1ecd
commit
d6615ab30c
2 changed files with 12 additions and 24 deletions
|
@ -12,18 +12,9 @@ import string; _string = string; del string
|
||||||
TkVersion = _string.atof(_tkinter.TK_VERSION)
|
TkVersion = _string.atof(_tkinter.TK_VERSION)
|
||||||
TclVersion = _string.atof(_tkinter.TCL_VERSION)
|
TclVersion = _string.atof(_tkinter.TCL_VERSION)
|
||||||
|
|
||||||
######################################################################
|
READABLE = _tkinter.READABLE
|
||||||
# Since the values of file event masks changed from Tk 4.0 to Tk 4.1,
|
WRITABLE = _tkinter.WRITABLE
|
||||||
# they are defined here (and not in Tkconstants):
|
EXCEPTION = _tkinter.EXCEPTION
|
||||||
######################################################################
|
|
||||||
if TkVersion >= 4.1:
|
|
||||||
READABLE = 2
|
|
||||||
WRITABLE = 4
|
|
||||||
EXCEPTION = 8
|
|
||||||
else:
|
|
||||||
READABLE = 1
|
|
||||||
WRITABLE = 2
|
|
||||||
EXCEPTION = 4
|
|
||||||
|
|
||||||
|
|
||||||
def _flatten(tuple):
|
def _flatten(tuple):
|
||||||
|
@ -706,6 +697,9 @@ class Tk(Misc, Wm):
|
||||||
for c in self.children.values(): c.destroy()
|
for c in self.children.values(): c.destroy()
|
||||||
self.tk.call('destroy', self._w)
|
self.tk.call('destroy', self._w)
|
||||||
Misc.destroy(self)
|
Misc.destroy(self)
|
||||||
|
global _default_root
|
||||||
|
if _default_root is self:
|
||||||
|
_default_root = None
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self._w
|
return self._w
|
||||||
def readprofile(self, baseName, className):
|
def readprofile(self, baseName, className):
|
||||||
|
|
|
@ -12,18 +12,9 @@ import string; _string = string; del string
|
||||||
TkVersion = _string.atof(_tkinter.TK_VERSION)
|
TkVersion = _string.atof(_tkinter.TK_VERSION)
|
||||||
TclVersion = _string.atof(_tkinter.TCL_VERSION)
|
TclVersion = _string.atof(_tkinter.TCL_VERSION)
|
||||||
|
|
||||||
######################################################################
|
READABLE = _tkinter.READABLE
|
||||||
# Since the values of file event masks changed from Tk 4.0 to Tk 4.1,
|
WRITABLE = _tkinter.WRITABLE
|
||||||
# they are defined here (and not in Tkconstants):
|
EXCEPTION = _tkinter.EXCEPTION
|
||||||
######################################################################
|
|
||||||
if TkVersion >= 4.1:
|
|
||||||
READABLE = 2
|
|
||||||
WRITABLE = 4
|
|
||||||
EXCEPTION = 8
|
|
||||||
else:
|
|
||||||
READABLE = 1
|
|
||||||
WRITABLE = 2
|
|
||||||
EXCEPTION = 4
|
|
||||||
|
|
||||||
|
|
||||||
def _flatten(tuple):
|
def _flatten(tuple):
|
||||||
|
@ -706,6 +697,9 @@ class Tk(Misc, Wm):
|
||||||
for c in self.children.values(): c.destroy()
|
for c in self.children.values(): c.destroy()
|
||||||
self.tk.call('destroy', self._w)
|
self.tk.call('destroy', self._w)
|
||||||
Misc.destroy(self)
|
Misc.destroy(self)
|
||||||
|
global _default_root
|
||||||
|
if _default_root is self:
|
||||||
|
_default_root = None
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self._w
|
return self._w
|
||||||
def readprofile(self, baseName, className):
|
def readprofile(self, baseName, className):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue