I am working on a progress bar in Tkinter using object-oriented design, and I'm having an issue.
from tkinter import *
from tkinter import ttk
class Status:
def __init__(self):
self.root = Tk()
self.root.geometry("400x20")
self.loading = ttk.Progressbar(self.root, length=15, value=0, orient=HORIZONTAL, command=self.start_progress())
self.loading.pack(fill=X)
self.root.mainloop()
def start_progress(self):
self.loading.start(10)
bar = Status()
I'm supposed to get a progress bar which indefinitely loads, but instead, I'm getting
"self.loading.start(10)
AttributeError: 'Status' object has no attribute 'loading'".
What I want is for the progress bar to automatically update without the use of any button. it should fill up and stop when it is full.