Merge remote-tracking branch 'origin/master'

This commit is contained in:
Tom Schimansky 2022-12-10 13:40:29 +01:00
commit 84bfc776b0
3 changed files with 8 additions and 9 deletions

View File

@ -1,4 +1,5 @@
include customtkinter/assets/*
include customtkinter/assets/fonts/*
include customtkinter/assets/fonts/Roboto/*
include customtkinter/assets/themes/*
include customtkinter/assets/icons/*
include customtkinter/assets/themes/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

View File

@ -40,15 +40,13 @@ 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)
# 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"))
except Exception:
pass
self._current_width = 600 # initial window size, independent of scaling
self._current_height = 500