New submission from Gabe <gabe.milli...@gmail.com>:

In the following code: 
```py
import tkinter as tk
from tkinter import ttk

import ctypes
ctypes.windll.user32.SetProcessDPIAware()

w = tk.Tk()
ttk.Checkbutton(w, text = "Checkbox").grid()
w.mainloop()
```

The checkbox begins as normal size, but after hovering over it, it becomes 
small. See attached gif.

The issue does not occur without the SetProcessDPIAware call. 

I am running Windows 11, and my screen resolution is 2560x1440. My 
Settings>System>Display>Custom Scaling is set to 150%. I believe that this is 
relevant because SetProcessDPIAware() directly affects the dpi awareness (aka 
'custom scaling') of the program, according to Microsoft documentation.

----------
components: Tkinter
files: KwUqCTWl58.gif
messages: 405401
nosy: GabeMillikan
priority: normal
severity: normal
status: open
title: tkinter breaks on high resolution screen after ctypes 
SetProcessDPIAware()
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50413/KwUqCTWl58.gif

_______________________________________
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