Replies: 2 comments 3 replies
-
Your example is not working because the for loop happens instantly with no delay. For timed events there is the after() method in tkinter/customtkinter. You need to use the after() method, so that the UI is not blocked like if it would be if you use time.sleep() or something similar. import customtkinter
def start_progressbar(value):
progressbar.set(value)
if value < 1:
# after() arguments: time in ms, function to call, arguments to the function
app.after(1000, start_progressbar, value + 1/10)
app = customtkinter.CTk()
progressbar = customtkinter.CTkProgressBar(master=app)
progressbar.pack(padx=20, pady=20)
progressbar.set(0.0)
start_progressbar(0)
app.mainloop() |
Beta Was this translation helpful? Give feedback.
3 replies
-
https://www.delftstack.com/img/Tkinter/Text%20in%20Tkinter%20Progress%20Bar.gif |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to update a progress bar in a loop?
def update_progressbar():
for n in range(10):
progressbar.set(n/10)
progressbar = customtkinter.CTkProgressBar(master=frame_1,)
progressbar.place(x=20,y=380)
progressbar.set(0.0)
Beta Was this translation helpful? Give feedback.
All reactions