]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Restructured the event_* calls slightly -- there's really no need to
authorGuido van Rossum <guido@python.org>
Mon, 6 Apr 1998 03:10:03 +0000 (03:10 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 6 Apr 1998 03:10:03 +0000 (03:10 +0000)
use the default root, and instead of string.split, use splitlist.

Lib/lib-tk/Tkinter.py

index 63e521d1f8bce6ee926aad1f2553ed4bda780e2f..51bcb67653a929a3bb23e6764d86071ac5895765 100644 (file)
@@ -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: