Tkinter Progressbar Indeterminate Mode
In this mode the pointer will move left and right, the main purpose is to let the user know that the program is still continuing to work.
Example#1
Set the mode of Progressbar to indeterminate, this program can see the pointer move left and right when executing, if you click the Stop button to stop the pointer movement.
from tkinter import *
from tkinter.ttk import *
def run(): # Start Progressbar animation
print("run() Executed!!!")
pb.start() # Pointer moves 1 at a time
def stop(): # Terminate Progressbar animation
print("stop() Executed!!!")
pb.stop() # Terminate pb object animation
root = Tk()
root.title("apidemos.com")
pb = Progressbar(root,length=200,mode="indeterminate",orient=HORIZONTAL)
pb.pack(padx=5,pady=10)
pb["maximum"] = 100
pb["value"] = 0
btnRun = Button(root,text="Run",command=run) # Create Run button
btnRun.pack(side=LEFT,padx=5,pady=10)
btnStop = Button(root,text="Stop",command=stop) # Create Stop button
btnStop.pack(side=LEFT,padx=5,pady=10)
root.mainloop()
Output: