# Simulate data loading and update the progress bar for i in range(len(data)): # Load data here... progress = int((i + 1) / len(data) * 100) self.progress_bar.update_progress(progress) root.update_idletasks() # Add a small delay to simulate loading time import time time.sleep(0.01)
def update_progress(self, progress): self.progress = progress self.progress_bar['value'] = progress self.progress_label['text'] = f"Loading... {progress}%" xloader
def pack(self): super().pack() Modify the XLoader class to include the ProgressBar component and update its progress in real-time as the data is loaded. # Simulate data loading and update the progress