readme change

This commit is contained in:
Tom Schimansky 2021-03-05 20:40:25 +01:00
parent 4374884d65
commit 8370521d2a
2 changed files with 17 additions and 2 deletions

View File

@ -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
</details>
#
### 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
```

View File

@ -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: