summaryrefslogtreecommitdiff
path: root/jfr_playoff/gui/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff/gui/__init__.py')
-rw-r--r--jfr_playoff/gui/__init__.py16
1 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)