added icon on Windows for CTkToplevel, fixed #960

This commit is contained in:
TomSchimansky
2023-01-07 01:16:15 +01:00
parent 1396a7e484
commit 8a537076ce
2 changed files with 9 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ class CTk(tkinter.Tk, CTkAppearanceModeBaseClass, CTkScalingBaseClass):
# Set Windows titlebar icon
if sys.platform.startswith("win"):
customtkinter_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
self.iconbitmap(os.path.join(customtkinter_directory, "assets", "icons", "CustomTkinter_icon_Windows.ico"))
self.after(200, lambda: self.iconbitmap(os.path.join(customtkinter_directory, "assets", "icons", "CustomTkinter_icon_Windows.ico")))
except Exception:
pass