From 8370521d2aa2e263fdcbb28fd6cbffb6317d1920 Mon Sep 17 00:00:00 2001 From: Tom Schimansky Date: Fri, 5 Mar 2021 20:40:25 +0100 Subject: [PATCH] readme change --- Readme.md | 17 ++++++++++++++++- customtkinter/__init__.py | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 0617758..2539d0d 100644 --- a/Readme.md +++ b/Readme.md @@ -254,4 +254,19 @@ fg_color | forground color, tuple: (light_color, dark_color) or single color bg_color | background color, tuple: (light_color, dark_color) or single color -# \ No newline at end of file +### Special commands +Use macOS darkmode window style: +```python +import customtkinter + +customtkinter.enable_macos_darkmode() # get darkmode window style +customtkinter.disable_macos_darkmode() # disable darkmode (important!) +``` + +If you dont use ``root_tk.mainloop()``, then you have to deactivate +the threaded search for a change of the system appearance mode, and +do it yourself in your main loop where you call ``root_tk.update()``. +```python +customtkinter.deactivate_threading() # call this at the beginning +customtkinter.update_appearance_mode() # then call this in the loop +``` diff --git a/customtkinter/__init__.py b/customtkinter/__init__.py index b08b99c..32624b9 100644 --- a/customtkinter/__init__.py +++ b/customtkinter/__init__.py @@ -65,7 +65,7 @@ def activate_threading(): AppearanceModeTracker.init_listener_function() -def update_theme(): +def update_appearance_mode(): if isinstance(AppearanceModeTracker.system_mode_listener, SystemAppearanceModeListenerNoThread): AppearanceModeTracker.system_mode_listener.update() else: