CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Default Ctk logo on windows

Open rc4000 opened this issue 3 years ago • 2 comments

now the ctk logo is shown by default when creating a window

img2 img1

rc4000 avatar Dec 04 '22 23:12 rc4000

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.

TomSchimansky avatar Dec 04 '22 23:12 TomSchimansky

On macOS you can use the .iconphoto method to set a PNG

sumeshir26 avatar Dec 05 '22 01:12 sumeshir26

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.

TomSchimansky avatar Dec 10 '22 12:12 TomSchimansky

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

its-jd avatar Apr 20 '23 08:04 its-jd