The following code starts the progress bar by clicking start
# root window
root = tk.Tk()
root.geometry('300x120')
root.title('Progressbar Demo')
root.grid()
# progressbar
pb = ttk.Progressbar(
root,
orient='horizontal',
mode='indeterminate',
length=280
)
# place the progressbar
pb.grid(column=0, row=0, columnspan=2, padx=10, pady=20)
start_button = ttk.Button(
root,
text='Start',
command=pb.start
)
start_button.grid(column=0, row=1, padx=10, pady=10, sticky=tk.E)
root.mainloop()
how can the progressbar be started without a button? so just by calling a function? So basically I want the progressbar to start directly by executing the code. Something like this:
# root window
root = tk.Tk()
root.geometry('300x120')
root.title('Progressbar Demo')
root.grid()
# progressbar
pb = ttk.Progressbar(
root,
orient='horizontal',
mode='indeterminate',
length=280
)
# place the progressbar
pb.grid(column=0, row=0, columnspan=2, padx=10, pady=20)
pb.start
root.mainloop()