summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2024-04-26 21:27:58 (GMT)
committerGitHub <noreply@github.com>2024-04-26 21:27:58 (GMT)
commit194fd17bc6cb73138e2fe8eb5ca34b19a6c3b25a (patch)
tree1bf54e346229e095933c7a79a0bc4fbaab11d679 /Lib/tkinter
parentb43c7e1070e515b3e94043ff777ab83074234051 (diff)
downloadcpython-194fd17bc6cb73138e2fe8eb5ca34b19a6c3b25a.zip
cpython-194fd17bc6cb73138e2fe8eb5ca34b19a6c3b25a.tar.gz
cpython-194fd17bc6cb73138e2fe8eb5ca34b19a6c3b25a.tar.bz2
bpo-32839: Add the after_info() method for Tkinter widgets (GH-5664)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index fd7b48e..70a1ed4 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -897,6 +897,21 @@ class Misc:
pass
self.tk.call('after', 'cancel', id)
+ def after_info(self, id=None):
+ """Return information about existing event handlers.
+
+ With no argument, return a tuple of the identifiers for all existing
+ event handlers created by the after and after_idle commands for this
+ interpreter. If id is supplied, it specifies an existing handler; id
+ must have been the return value from some previous call to after or
+ after_idle and it must not have triggered yet or been canceled. If the
+ id doesn't exist, a TclError is raised. Otherwise, the return value is
+ a tuple containing (script, type) where script is a reference to the
+ function to be called by the event handler and type is either 'idle'
+ or 'timer' to indicate what kind of event handler it is.
+ """
+ return self.tk.splitlist(self.tk.call('after', 'info', id))
+
def bell(self, displayof=0):
"""Ring a display's bell."""
self.tk.call(('bell',) + self._displayof(displayof))