diff options
author | Zhikang Yan <2951256653@qq.com> | 2024-12-01 19:29:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-01 19:29:27 (GMT) |
commit | 7ea523f47cdb4cf512a1e2ae1f93f5d19a48945d (patch) | |
tree | 0884a16b969713d9cb7755c6703d0146c8d39702 /Lib/tkinter | |
parent | 04673d2f14414fce7a2372de3048190f66488e6e (diff) | |
download | cpython-7ea523f47cdb4cf512a1e2ae1f93f5d19a48945d.zip cpython-7ea523f47cdb4cf512a1e2ae1f93f5d19a48945d.tar.gz cpython-7ea523f47cdb4cf512a1e2ae1f93f5d19a48945d.tar.bz2 |
gh-126899: Add `**kw` to `tkinter.Misc.after` and `tkinter.Misc.after_idle` (#126900)
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index dd7b3e1..bfec04b 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -847,7 +847,7 @@ class Misc: if not name: return None return self._nametowidget(name) - def after(self, ms, func=None, *args): + def after(self, ms, func=None, *args, **kw): """Call function once after given time. MS specifies the time in milliseconds. FUNC gives the @@ -861,7 +861,7 @@ class Misc: else: def callit(): try: - func(*args) + func(*args, **kw) finally: try: self.deletecommand(name) @@ -875,13 +875,13 @@ class Misc: name = self._register(callit) return self.tk.call('after', ms, name) - def after_idle(self, func, *args): + def after_idle(self, func, *args, **kw): """Call FUNC once if the Tcl main loop has no event to process. Return an identifier to cancel the scheduling with after_cancel.""" - return self.after('idle', func, *args) + return self.after('idle', func, *args, **kw) def after_cancel(self, id): """Cancel scheduling of function identified with ID. |