fixed simple_example.py

This commit is contained in:
Tom Schimansky
2022-05-05 20:25:37 +02:00
parent 8c0f1d2c43
commit 3eb0d411c5
8 changed files with 113 additions and 17 deletions

View File

@@ -67,6 +67,15 @@ def set_default_color_theme(color_string):
CTkThemeManager.load_theme(color_string)
def deactivate_dpi_awareness(deactivate_awareness: bool):
CTkSettings.deactivate_automatic_dpi_awareness = deactivate_awareness
def set_user_scaling(scaling_value: float):
ScalingTracker.set_spacing_scaling(scaling_value)
ScalingTracker.set_widget_scaling(scaling_value)
# Load fonts:
if sys.platform.startswith("win"):
from ctypes import windll, byref, create_unicode_buffer, create_string_buffer
@@ -106,7 +115,7 @@ if sys.platform.startswith("win"):
"Using 'circle_shapes' instead. The rendering quality will be very bad!")
CTkSettings.preferred_drawing_method = "circle_shapes"
elif sys.platform == "linux":
elif sys.platform.startswith("linux"):
try:
if not os.path.isdir(os.path.expanduser('~/.fonts/')):
os.mkdir(os.path.expanduser('~/.fonts/'))