Gabe <gabe.milli...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45681>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to