feat: gui progressbar simple

This commit is contained in:
Yannik Schmidt
2024-03-10 23:27:37 +01:00
parent a770523e1f
commit 9ebdca865d
5 changed files with 52 additions and 12 deletions

21
pgwrapper.py Normal file
View File

@@ -0,0 +1,21 @@
import customtkinter
class ProgressBarWrapper:
'''Provide a progress bar wrapper, so PGs can be created and destroyed
on the GUI level without affecting the references stored for updates
in the DataBackend and Software Objects'''
def __init__(self):
self.progress_bar = None
def new(self, tk_parent):
self.progress_bar = customtkinter.CTkProgressBar(tk_parent)
self.progress_bar["maximum"] = 10000
self.progress_bar.set(0)
return self.progress_bar
def get_pb(self):
if self.progress_bar:
return self.progress_bar
else:
raise AssertionError("No progress bar in this wrapper created")