Skip to content

Commit 4d0cd99

Browse files
committed
Bug fixes
1 parent a2c9965 commit 4d0cd99

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

main.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import numexpr as ne
23
import numpy as np
34
from PIL import Image
@@ -80,6 +81,10 @@ def __init__(self):
8081
super().__init__()
8182
self.home_text_var = ctk.StringVar()
8283

84+
self.main_dir = os.path.dirname(os.path.realpath(__file__))
85+
self.folder_path = os.path.join(self.main_dir, "resources")
86+
X = os.path.join(self.folder_path, "images\\exit.png")
87+
8388
# Configuration
8489
self.title("Numerical Analysis")
8590

@@ -115,7 +120,10 @@ def __init__(self):
115120
hover_color="red",
116121
command=lambda title="home": self.display_page(title),
117122
image=ctk.CTkImage(
118-
light_image=Image.open("./resources/images/home.png"), size=(40, 40)
123+
light_image=Image.open(
124+
os.path.join(self.folder_path, "images\\home.png")
125+
),
126+
size=(40, 40),
119127
),
120128
)
121129
self.home_button.pack(side="right", anchor="ne", padx=5, pady=5)
@@ -130,7 +138,10 @@ def __init__(self):
130138
hover_color="#FF0",
131139
command=self.quit,
132140
image=ctk.CTkImage(
133-
light_image=Image.open("./resources/images/exit.png"), size=(40, 40)
141+
light_image=Image.open(
142+
os.path.join(self.folder_path, "images\\exit.png")
143+
),
144+
size=(40, 40),
134145
),
135146
)
136147
button_exit.pack(side="right", anchor="ne", pady=5)
@@ -145,8 +156,8 @@ def __init__(self):
145156
main_label.place(relx=0.5, rely=0.5, anchor="center")
146157

147158
button_images = [
148-
"./resources/images/button1.png",
149-
"./resources/images/button2.png",
159+
os.path.join(self.folder_path, "images\\button1.png"),
160+
os.path.join(self.folder_path, "images\\button2.png"),
150161
]
151162
button_titles = ["Linear Systems", "Numerical Integration"]
152163

@@ -361,7 +372,9 @@ def solveX(radiovar):
361372
font=("Trebuchet MS Bold", 32),
362373
compound="right",
363374
image=ctk.CTkImage(
364-
light_image=Image.open("./resources/images/integral.png"),
375+
light_image=Image.open(
376+
os.path.join(self.folder_path, "images\\integral.png")
377+
),
365378
size=(60, 160),
366379
),
367380
)

0 commit comments

Comments
 (0)