Skip to content

Commit 416732e

Browse files
authored
Merge pull request #6 from mondeendeguise/cross-platform
fix: load icons with PIL before sourcing
2 parents 08246fc + 57b7221 commit 416732e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/gui.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from tkinter import filedialog
2121
import tkinter as tk
2222
import os
23-
from PIL import Image
23+
from PIL import Image, ImageTk
2424
import configparser
2525
import pscoverdl
2626
import requests
@@ -35,7 +35,8 @@ def __init__(self):
3535
icon_path = os.path.join(
3636
os.path.dirname(os.path.realpath(__file__)), "app/icon.ico"
3737
)
38-
self.iconbitmap(icon_path)
38+
icon_photo = ImageTk.PhotoImage(Image.open(icon_path))
39+
self.wm_iconphoto(True, icon_photo)
3940
self.geometry("450x350")
4041
self.resizable(False, False)
4142
self.font = ("MS Sans Serif", 12, "bold")
@@ -45,10 +46,10 @@ def __init__(self):
4546
image_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "icons")
4647

4748
self.ps1_image = ctk.CTkImage(
48-
Image.open(image_path + "/PS1.png"), size=(20, 20)
49+
Image.open(image_path + "/ps1.png"), size=(20, 20)
4950
)
5051
self.ps2_image = ctk.CTkImage(
51-
Image.open(image_path + "/PS2.png"), size=(20, 20)
52+
Image.open(image_path + "/ps2.png"), size=(20, 20)
5253
)
5354

5455
# region nav frame

0 commit comments

Comments
 (0)