Skip to content

Commit

Permalink
fix: Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
dsafxP committed Dec 14, 2024
1 parent 5d091e9 commit 3274ccc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from tkinter import ttk
import asyncio
import threading
import sys
import os
from app.fetcher import fetch_game_servers

class GameServersApp:
Expand All @@ -11,7 +13,7 @@ def __init__(self, root):
self.root.geometry("600x400")

# Set a custom icon
self.root.iconbitmap("img/SFDicon.ico") # Replace with your .ico file path
self.root.iconbitmap(resource_path("img/SFDicon.ico")) # Replace with your .ico file path

# Apply a custom theme
self.style = ttk.Style()
Expand Down Expand Up @@ -172,6 +174,11 @@ def start_auto_fetch(self):
self.root.after(self.fetch_interval,
self.start_auto_fetch) # Set the next fetch after the interval

def resource_path(relative_path):
""" Get the absolute path to the resource, works for development and for PyInstaller. """
base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
return os.path.join(base_path, relative_path)

def run_gui():
"""Set up the main Tkinter GUI window and start the application."""
root = tk.Tk()
Expand Down

0 comments on commit 3274ccc

Please sign in to comment.