progress bar en ttk¶
import tkinter as tk
from tkinter import ttk
def click(event):
# can be a float
increment = 10
pbar.start()
#pbar.step(increment)
root = tk.Tk()
root.title('ttk.Progressbar')
pbar = ttk.Progressbar(root, length=300, mode='determinate')
pbar.pack(padx=5, pady=5)
btn = tk.Button(root, text="Click to advance progress bar")
# bind to left mouse button click
btn.bind("<Button-1>", click)
btn.pack(pady=10)
root.mainloop()
vous pouvez changer l’option mode: determinate / indeterminate