From 3ad792c0834dad4360d184326a88057b8ff123bb Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 30 Nov 2020 21:39:25 +0100 Subject: [PATCH] affichage fenetre tk fonctionnelle --- soui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/soui.py b/soui.py index 1deb6b9..78379ab 100644 --- a/soui.py +++ b/soui.py @@ -36,14 +36,16 @@ class Affichage: self.notspeaking = "not_speaking.png" def refresh(self): - self.canvas.config(image = PhotoImage(file = self.get_image())) + self.canvas.itemconfig(self.canvas_image, image = PhotoImage(master = self.fenetre, file = self.get_image())) self.fenetre.update_idletasks() self.fenetre.after(self.buffer, self.refresh) def get_image(self): if Microphone().get_status_speaking(): + print("parle") return self.speaking else: + print("parle pas") return self.notspeaking def start(self): @@ -51,7 +53,7 @@ class Affichage: self.fenetre.title('Microphone') self.canvas = Canvas(self.fenetre) self.canvas.configure(width = 1080, height = 2140) - self.canvas.create_image(540, 1070, image = PhotoImage(file = self.get_image())) + self.canvas_image = self.canvas.create_image(540, 1070, image = PhotoImage(master = self.fenetre, file = self.get_image())) self.refresh()