Message405450
The exact same effect happens with SetProcessDPIAware(1). The IDLE checkboxes are in fact affected; they're tiny. I discovered that I was able to prevent the issue by using `ctypes.windll.shcore.SetProcessDpiAwareness(0)`. This prevents the issue only if it is called prior to the SetProcessDPIAware call.
This code does not have any issues (everything is correctly scaled)
```
import tkinter as tk
from tkinter import ttk
import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(0)
ctypes.windll.user32.SetProcessDPIAware()
w = tk.Tk()
ttk.Checkbutton(w, text = "Checkbox").grid()
w.mainloop()
```
If the SetProcessDpiAwareness call comes after the SetProcessDPIAware call, then the error persists. I believe that this is because Windows only listens to the first DPI configuration call, so it ignores subsequent calls. I was unable to find documentation to support this though. |
|
Date |
User |
Action |
Args |
2021-11-01 16:40:07 | GabeMillikan | set | recipients:
+ GabeMillikan, terry.reedy, serhiy.storchaka, epaine |
2021-11-01 16:40:07 | GabeMillikan | set | messageid: <1635784807.42.0.643109504408.issue45681@roundup.psfhosted.org> |
2021-11-01 16:40:07 | GabeMillikan | link | issue45681 messages |
2021-11-01 16:40:07 | GabeMillikan | create | |
|