]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Support for the "event" command, new in Tk 4.2.
authorGuido van Rossum <guido@python.org>
Tue, 2 Dec 1997 19:51:39 +0000 (19:51 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 2 Dec 1997 19:51:39 +0000 (19:51 +0000)
By Case Roole.

Lib/lib-tk/Tkinter.py

index 2883380e3c09bf955991d43db62b1488580d6fa2..3cd5768d342c5d0d1e57ed626335fe7d8fc66c0e 100644 (file)
@@ -699,6 +699,30 @@ class Misc:
                                   apply(self.tk.call,
                                         ('grid', 'slaves', self._w) + args)))
 
+       # Support for the "event" command, new in Tk 4.2.
+       # By Case Roole.
+
+       def event_add(self,virtual, *sequences):
+               args = ('event', 'add', virtual) + sequences
+               apply( _default_root.tk.call, args )
+
+       def event_delete(self,virtual,*sequences):
+               args = ('event', 'delete', virtual) + sequences
+               apply( _default_root.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)
+
+
 class CallWrapper:
        def __init__(self, func, subst, widget):
                self.func = func