gh-126899: Add **kw to tkinter.Misc.after and tkinter.Misc.after_idle (#126900)

---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Zhikang Yan 2024-12-02 03:29:27 +08:00 committed by GitHub
parent 04673d2f14
commit 7ea523f47c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 31 additions and 8 deletions

View file

@ -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.