add icons

This commit is contained in:
Tom Schimansky 2022-12-10 13:17:55 +01:00
parent 28228316eb
commit 9f8b54563d
3 changed files with 10 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -40,6 +40,16 @@ class CTk(tkinter.Tk, CTkAppearanceModeBaseClass, CTkScalingBaseClass):
CTkScalingBaseClass.__init__(self, scaling_type="window")
check_kwargs_empty(kwargs, raise_error=True)
# set icons
try:
customtkinter_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if sys.platform == "darwin":
self.tk.call('wm', 'iconphoto', self._w, tkinter.PhotoImage(file=os.path.join(customtkinter_directory, "assets", "icons", "CustomTkinter_icon_macOS.png")))
elif sys.platform.startswith("win"):
pass
except Exception as e:
print(e)
self._current_width = 600 # initial window size, independent of scaling
self._current_height = 500
self._min_width: int = 0