diff options
author | Guido van Rossum <guido@python.org> | 1998-04-06 03:10:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-04-06 03:10:03 (GMT) |
commit | 56c04b837654c2dc51788a6d6a90a9f58e3dd57a (patch) | |
tree | 7ff7afc01fb7c65333cdc7a463f1b69c40c52e81 /Lib/lib-tk/Tkinter.py | |
parent | af370ea25419a699aabd7e1d4b62b273f05d943a (diff) | |
download | cpython-56c04b837654c2dc51788a6d6a90a9f58e3dd57a.zip cpython-56c04b837654c2dc51788a6d6a90a9f58e3dd57a.tar.gz cpython-56c04b837654c2dc51788a6d6a90a9f58e3dd57a.tar.bz2 |
Restructured the event_* calls slightly -- there's really no need to
use the default root, and instead of string.split, use splitlist.
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 63e521d..51bcb676 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -712,27 +712,24 @@ class Misc: # Support for the "event" command, new in Tk 4.2. # By Case Roole. - # XXX Why is this using the default root? - def event_add(self,virtual, *sequences): + def event_add(self, virtual, *sequences): args = ('event', 'add', virtual) + sequences - apply( _default_root.tk.call, args ) + apply(self.tk.call, args) - def event_delete(self,virtual,*sequences): + def event_delete(self, virtual, *sequences): args = ('event', 'delete', virtual) + sequences - apply( _default_root.tk.call, args ) + apply(self.tk.call, args) def event_generate(self, sequence, **kw): args = ('event', 'generate', self._w, sequence) - for k,v in kw.items(): - args = args + ('-%s' % k,str(v)) - apply( _default_root.tk.call, args ) - - def event_info(self,virtual=None): - args = ('event', 'info') - if virtual is not None: args = args + (virtual,) - s = apply( _default_root.tk.call, args ) - return _string.split(s) + for k, v in kw.items(): + args = args + ('-%s' % k, str(v)) + apply(self.tk.call, args) + + def event_info(self, virtual=None): + return self.tk.splitlist( + self.tk.call('event', 'info', virtual)) class CallWrapper: |