Skip to content

Commit

Permalink
Add the icon in Tk
Browse files Browse the repository at this point in the history
  • Loading branch information
CoffeeCoder1 committed Aug 30, 2024
1 parent 1c581d9 commit e7e763a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/email_draft_generator/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import concurrent.futures
from pathlib import Path
import threading
from PIL import ImageTk
import platform

import tkinter as tk
from tkinter import ttk
Expand Down Expand Up @@ -166,5 +168,14 @@ def main():
root = tk.Tk()
root.title("E-mail Generator")
root.resizable(False, False)

# App icon
if platform.system() == 'Darwin': # Show a different icon on MacOS than anywhere else
icon_file = 'assets/icon_macos.png'
else:
icon_file = 'assets/icon.png'
photo = ImageTk.PhotoImage(file=icon_file)
root.wm_iconphoto(False, photo) # type: ignore

app = App(root)
app.mainloop()

0 comments on commit e7e763a

Please sign in to comment.