From 06375233c962101fe120dca5879d2a1dc50f8054 Mon Sep 17 00:00:00 2001 From: torzdf <36920800+torzdf@users.noreply.github.com> Date: Sat, 26 Jan 2019 11:06:37 +0000 Subject: [PATCH] Fix png icons for older tkinter versions --- lib/gui/utils.py | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/lib/gui/utils.py b/lib/gui/utils.py index cca114ad6d..3b75737e56 100644 --- a/lib/gui/utils.py +++ b/lib/gui/utils.py @@ -175,35 +175,19 @@ def __init__(self, pathcache=None): self.previewoutput = None self.previewtrain = dict() self.errcount = 0 - self.icons = dict() - self.icons["folder"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "open_folder.png")) - self.icons["load"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "open_file.png")) - self.icons["context"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "open_file.png")) - self.icons["save"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "save.png")) - self.icons["reset"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "reset.png")) - self.icons["clear"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "clear.png")) - self.icons["graph"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "graph.png")) - self.icons["zoom"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "zoom.png")) - self.icons["move"] = tk.PhotoImage(file=os.path.join( - self.pathicons, - "move.png")) + self.icons["folder"] = ImageTk.PhotoImage(file=os.path.join( + self.pathicons, "open_folder.png")) + self.icons["load"] = ImageTk.PhotoImage(file=os.path.join( + self.pathicons, "open_file.png")) + self.icons["context"] = ImageTk.PhotoImage(file=os.path.join( + self.pathicons, "open_file.png")) + self.icons["save"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "save.png")) + self.icons["reset"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "reset.png")) + self.icons["clear"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "clear.png")) + self.icons["graph"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "graph.png")) + self.icons["zoom"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "zoom.png")) + self.icons["move"] = ImageTk.PhotoImage(file=os.path.join(self.pathicons, "move.png")) logger.debug("Initialized %s: (icons: %s)", self.__class__.__name__, self.icons) def delete_preview(self):