mirror of
https://github.com/FAUSheppy/homelab_gamevault
synced 2025-12-06 06:51:36 +01:00
feat: gui progressbar simple
This commit is contained in:
21
pgwrapper.py
Normal file
21
pgwrapper.py
Normal 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")
|
||||
Reference in New Issue
Block a user