diff --git a/taskon/main.py b/taskon/main.py index 43212e9..1d38803 100644 --- a/taskon/main.py +++ b/taskon/main.py @@ -23,10 +23,12 @@ def main(): root.geometry("250x350") root.config(padx=5, pady=5, bg="#fdfdfd") root.resizable(False, False) - root.iconbitmap("assets/images/growing-seed.ico") - # Load all necessary image resources loader = ResourceLoader() + + icon_path = loader.get_resource_path("growing-seed.ico") + root.iconbitmap(icon_path) + images = { "moon": loader.load_image("clock-green.png"), "oak": loader.load_image("growing-seed.png"), diff --git a/taskon/resources.py b/taskon/resources.py index 54e7374..906bb77 100644 --- a/taskon/resources.py +++ b/taskon/resources.py @@ -39,3 +39,15 @@ def load_image(self, filename: str): """ path = os.path.join(self.base_path, filename) return PhotoImage(file=path) if os.path.exists(path) else None + + def get_resource_path(self, filename: str) -> str: + """ + Get the absolute file path for a resource file. + + Args: + filename: Name of the resource file. + + Returns: + Absolute path to the resource file. + """ + return os.path.join(self.base_path, filename) \ No newline at end of file