Passing parameters to a callback with tkinter.after Passing parameters to a callback with tkinter.after tkinter tkinter

Passing parameters to a callback with tkinter.after


You are calling update_scrollbox instead of passing the callback as an object.
after takes parameters to the callback, you can do like this:

window.after(5000, update_scrollbox, "First update")


after expects a callback. Right now you are calling the function and passing its return value as soon as you start your program.

To pass a parameter to callback, you can use lambda.

window.after(5000, lambda: update_scrollbox("First update"))