CustomTkinter
CustomTkinter copied to clipboard
Default Ctk logo on windows
now the ctk logo is shown by default when creating a window
Thats a nice addition, I already thought about doing this. But I tried it on macOS and the iconbitmap method had no effect on the icon, so it does not work on macOS. Maybe I will find an other method or it will just work on Windows, I will think about this.
On macOS you can use the .iconphoto method to set a PNG
I added the the titlebar icon for Windows now with a correctly cropped image, try-except block and path handling with os.path.join, so I will close this. But thanks for the request.
I added the the titlebar icon for Windows now with a correctly cropped image, try-except block and path handling with os.path.join, so I will close this. But thanks for the request.
This prevents setting custom icon for new top level window.
Specfically line num 41 to 47 in ctk_toplevel.py
try:
# Set Windows titlebar icon
if sys.platform.startswith("win"):
customtkinter_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
self.after(200, lambda: self.iconbitmap(os.path.join(customtkinter_directory, "assets", "icons", "CustomTkinter_icon_Windows.ico")))
except Exception:
pass