diff options
author | Guido van Rossum <guido@python.org> | 1997-12-02 19:51:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-12-02 19:51:39 (GMT) |
commit | 80f8be8901c8c6591986408ef191574caf30c85c (patch) | |
tree | 6387112ca468cd1a4fe727f306fca6747cde7b33 /Lib/lib-tk/Tkinter.py | |
parent | 2888a12eedaa99e94aa08cc47fa1e583eb468fa1 (diff) | |
download | cpython-80f8be8901c8c6591986408ef191574caf30c85c.zip cpython-80f8be8901c8c6591986408ef191574caf30c85c.tar.gz cpython-80f8be8901c8c6591986408ef191574caf30c85c.tar.bz2 |
Support for the "event" command, new in Tk 4.2.
By Case Roole.
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 2883380..3cd5768 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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 |