summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-02-12 19:46:18 -0300
committerJesusaves <cpntb1@ymail.com>2024-02-12 19:46:18 -0300
commitc3a8d67e1fab546635d074c51fe12de6aa302bbe (patch)
tree7fb649ea593741c58649df2bcb7d234f722d6433 /__main__.py
parent9efe4c473fd999e70b1b43eb58cdb52428c31f56 (diff)
downloadtkinter-c3a8d67e1fab546635d074c51fe12de6aa302bbe.tar.gz
tkinter-c3a8d67e1fab546635d074c51fe12de6aa302bbe.tar.bz2
tkinter-c3a8d67e1fab546635d074c51fe12de6aa302bbe.tar.xz
tkinter-c3a8d67e1fab546635d074c51fe12de6aa302bbe.zip
Add a fallback if the images cannot be loaded (making the exe standalone)
Diffstat (limited to '__main__.py')
-rwxr-xr-x__main__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/__main__.py b/__main__.py
index 9e15e4a..bd116bf 100755
--- a/__main__.py
+++ b/__main__.py
@@ -719,8 +719,13 @@ root=tk.Tk()
root.title("Mana Launcher (tk)")
## Initialize the images
-_cog_png = tk.PhotoImage(file = "cog.png")
-_favicon = tk.PhotoImage(file = "favicon.png")
+try:
+ _cog_png = tk.PhotoImage(file = "cog.png")
+ _favicon = tk.PhotoImage(file = "favicon.png")
+except:
+ from _img import __cog, __favicon
+ _cog_png = tk.PhotoImage(data = __cog)
+ _favicon = tk.PhotoImage(data = __favicon)
root.iconphoto(True, _favicon)
canva = tk.Canvas(root, width=400, height=600, bg="#0c3251")