I have a GUI containing multiple pages and I define all my functions under the parent class (APP). I am using the threading.Timer
to update the progress of a current function. This function is also defined under the parent class (let's call it update_time()
).
I have a progressbar on page three of the GUI that I would like to update every time the threading Timer
updates. How would I access the progressbar on page 3 of the GUI from the function update_time()
in order to update the progressbar with every threading timer update?
def update_time(self):
timer = threading.Timer(self.update_interval, self.update_time)
timer.start()
self.current_count += 1
current_percentage = self.current_count / self.total_count
current_percentage = current_percentage if current_percentage <= 1 else 1
# This is the progress bar that would reside on PageThree
PageThree.progress['value'] = round(current_percentage, 3) * 100
PageThree.style.configure('text.Horizontal.TProgressbar', text='{:.1%}'.format(current_percentage))
The PageThree.progress
obviously does not work, but I am looking for a similar idea of calling the progress bar within the class PageThree
and updating it to the current percentage.
PageThree
intoupdate_time()
each time it is called, or have it passed into the__init__()
of this class, so thatself.PageThree.progress...
will work. – quamrana