Skip to content

Commit 8eb6a73

Browse files
committed
Made icon selection cross-plattform
1 parent 547557c commit 8eb6a73

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed
17.2 KB
Loading

topasgraphsim/topasgraphsim.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import tkinter as tk
1212
import tkinter.ttk as ttk
13+
from tkinter import PhotoImage
1314

1415
from src.classes.main_viewer import MainApplication
1516

@@ -39,17 +40,18 @@ def topasgraphsim():
3940
)
4041
MainApplication(root)
4142

42-
icon = ("@resources", "icon.xbm")
43-
if "nt" == os.name:
44-
icon = ("resources", "icon.ico")
4543
root.after(
4644
50,
47-
root.wm_iconbitmap(
48-
bitmap=str(
49-
os.path.join(
50-
os.path.dirname(os.path.realpath(__file__)), "src", icon[0], icon[1]
45+
root.iconphoto(
46+
True,
47+
PhotoImage(
48+
file=os.path.join(
49+
os.path.dirname(os.path.realpath(__file__)),
50+
"src",
51+
"resources",
52+
"icon.png",
5153
)
52-
)
54+
),
5355
),
5456
)
5557
root.mainloop()

0 commit comments

Comments
 (0)