diff --git a/main.pyw b/main.pyw index 26f2c8e..6425a23 100644 --- a/main.pyw +++ b/main.pyw @@ -32,10 +32,13 @@ if not(os.path.exists("./statistic.pickle")): ######## initialisation ######## Fen = Tk() Fen.resizable(width = False, height = False) -Fen.iconbitmap(PATH_ASSETS + "icon.ico") +Fen.iconphoto(False, ImageTk.PhotoImage(file = PATH_ASSETS + "icon.ico")) Fen.title("Emulateur - Bombe") classModule = {} # Dictionnaire qui va contenir tout les modules afin qu'ils puissent intéragir entre eux +global DEFAULT_BG_COLOR +DEFAULT_BG_COLOR = Fen.cget("background") + for file in os.listdir(PATH_MODULE): # On cherche les modules dans leur dossier with open(PATH_MODULE + file, "rb") as module: # On les ouvres en lecture exec(module.read()) # On les executes diff --git a/module/display.py b/module/display.py index a43f67b..aedcc4d 100644 --- a/module/display.py +++ b/module/display.py @@ -40,7 +40,7 @@ class display(): else: self.label.config(foreground = "gold", background = "indianred") else: - self.label.config(foreground = "black", background = "SystemButtonFace") + self.label.config(foreground = "black", background = DEFAULT_BG_COLOR) if self.time >= 0: # Vérification que le joueur n'ai pas dépassé le temps imparti self.chrono_event = Fen.after(1000, self.chrono) @@ -104,7 +104,7 @@ class display(): def reset(self): # Cette fonction est appelé a chaque fin de partie pour réinitialiser ce module if App.InfinityMode == False: # Si l'on n'est pas en mode infini Fen.after_cancel(self.chrono_event) # On désactive le chrono - self.label.config(foreground = "black", background = "SystemButtonFace") + self.label.config(foreground = "black", background = DEFAULT_BG_COLOR) duration = time.time() - App.start_time duration_min, duration_sec = duration // 60, duration % 60 diff --git a/module/morse.py b/module/morse.py index 57ad9ca..7d2e6d6 100644 --- a/module/morse.py +++ b/module/morse.py @@ -39,7 +39,7 @@ class morse(): self.SelectFen = Toplevel() # Créer une fenêtre secondaire. self.SelectFen.resizable(width = False, height = False) - self.SelectFen.iconbitmap(PATH_ASSETS + "icon.ico") # Change l'icone + self.SelectFen.iconphoto(False, ImageTk.PhotoImage(file = PATH_ASSETS + "icon.ico")) # Change l'icone self.SelectFen.title("Emulateur - Morse") # Change le titre self.SelectFen.protocol('WM_DELETE_WINDOW', lambda: "pass") # Rend la fenêtre non fermable self.HideSymbol()