diff options
author | Guido van Rossum <guido@python.org> | 1994-07-07 13:12:12 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-07-07 13:12:12 (GMT) |
commit | 97aeca1527002537ae1f5a541fe86d75f7af1bfb (patch) | |
tree | 72ced814de9bec80bb1acc2249a0136dab3dfd2f /Lib/tkinter | |
parent | d308e2ba3e8e0f1e6e3c6fe3c716d2b9ce14c1fc (diff) | |
download | cpython-97aeca1527002537ae1f5a541fe86d75f7af1bfb.zip cpython-97aeca1527002537ae1f5a541fe86d75f7af1bfb.tar.gz cpython-97aeca1527002537ae1f5a541fe86d75f7af1bfb.tar.bz2 |
Added _exit and register as Tcl command exit. Micro lay-out fix.
Diffstat (limited to 'Lib/tkinter')
-rwxr-xr-x | Lib/tkinter/Tkinter.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 72e702c..c05704e 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -46,6 +46,10 @@ _default_root = None def _tkerror(err): pass +def _exit(code='0'): + import sys + sys.exit(getint(code)) + _varnum = 0 class Variable: def __init__(self, master=None): @@ -529,6 +533,7 @@ class Tk(Misc, Wm): if baseName[-3:] == '.py': baseName = baseName[:-3] self.tk = tkinter.create(screenName, baseName, className) self.tk.createcommand('tkerror', _tkerror) + self.tk.createcommand('exit', _exit) def destroy(self): for c in self.children.values(): c.destroy() ## del self.master.children[self._name] @@ -1078,8 +1083,7 @@ class Text(Widget): def tag_delete(self, *tagNames): apply(self.tk.call, (self._w, 'tag', 'delete') + tagNames) def tag_lower(self, tagName, belowThis=None): - self.tk.call(self._w, 'tag', 'lower', - tagName, belowThis) + self.tk.call(self._w, 'tag', 'lower', tagName, belowThis) def tag_names(self, index=None): return self.tk.splitlist( self.tk.call(self._w, 'tag', 'names', index)) |