Mettre la barre de progression à zéro lorsqu'on donne la valeur max.

This commit is contained in:
Sdj Geek 2020-07-28 16:51:42 +02:00
parent 87093bc92c
commit 9febc4cc55
1 changed files with 2 additions and 1 deletions

View File

@ -89,6 +89,7 @@ class MainApplication(tk.Frame):
elif message.get('running', False): elif message.get('running', False):
self.run = message['running'] self.run = message['running']
elif message.get('set_max', False): elif message.get('set_max', False):
self.progressbar["value"] = 0
self.progressbar['maximum'] = message['set_max'] self.progressbar['maximum'] = message['set_max']
self.parent.after(100, self.watch) self.parent.after(100, self.watch)
else: else:
@ -120,7 +121,7 @@ class Worker(Process):
self.pipe.send({'text': text}) self.pipe.send({'text': text})
elif set_max: elif set_max:
self.pipe.send({'set_max': set_max}) self.pipe.send({'set_max': set_max})
elif done: elif running:
self.pipe.send({'running': running}) self.pipe.send({'running': running})
def run(self): def run(self):