summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2022-03-15 22:55:55 +0100
committeremkael <emkael@tlen.pl>2022-03-15 22:55:55 +0100
commitc2dab703b1a364ee000f222714cbb9dccf736f92 (patch)
treeb61bd2bbdada795caa3e62d3e0bf007a81dc322e
parent236dfccd6c278f09f8b68e39bf72c456b2733fe5 (diff)
Window icon fix for Linux systems
-rw-r--r--jfr_playoff/gui/__init__.py16
-rw-r--r--jfr_playoff/gui/icons/playoff.gifbin0 -> 2312 bytes
2 files changed, 8 insertions, 8 deletions
diff --git a/jfr_playoff/gui/__init__.py b/jfr_playoff/gui/__init__.py
index 637e35c..546e1a1 100644
--- a/jfr_playoff/gui/__init__.py
+++ b/jfr_playoff/gui/__init__.py
@@ -26,17 +26,11 @@ class PlayoffGUI(tk.Tk):
ttk.Style().configure('TLabelframe.Label', foreground='black')
ttk.Style().configure('TLabelframe', padding=5)
self.geometry('920x640')
- try:
- self.iconbitmap(GuiImage.get_path('icons', 'playoff', 'ico'))
- except tk.TclError:
- pass # sometimes it fails on Linux, just ignore
+ self._setWindowIcon(self, GuiImage.get_icon('playoff'))
self.tabs = {}
self.logWindow = LogWindow(self)
self.logWindow.title('Dziennik komunikatów')
- try:
- self.logWindow.iconbitmap(GuiImage.get_path('icons', 'playoff', 'ico'))
- except tk.TclError:
- pass # sometimes it fails on Linux, just ignore
+ self._setWindowIcon(self.logWindow, GuiImage.get_icon('playoff'))
self._buildMenu()
self.newFileIndex = 0
self._title = tk.StringVar()
@@ -65,6 +59,12 @@ class PlayoffGUI(tk.Tk):
self.bind('<<BracketError>>', self._onBracketError, add='+')
self.mainloop()
+ def _setWindowIcon(self, window, icon):
+ try:
+ self.tk.call('wm', 'iconphoto', window._w, icon)
+ except tk.TclError:
+ pass # sometimes it fails on Linux, just ignore
+
def _onFileChange(self, *args):
self._dirty.set(True)
diff --git a/jfr_playoff/gui/icons/playoff.gif b/jfr_playoff/gui/icons/playoff.gif
new file mode 100644
index 0000000..2e86704
--- /dev/null
+++ b/jfr_playoff/gui/icons/playoff.gif
Binary files differ