[New-bugs-announce] [issue34918] Python 3 tkinter measurement problem

Adrian Keister report at bugs.python.org
Sun Oct 7 01:09:01 EDT 2018


New submission from Adrian Keister <Ackbeet at gmail.com>:

tkinter.Tk().winfo_screenmmwidth() and tkinter.Tk().winfo_screenmmheight() give manifestly incorrect values in Windows. This does not appear to be an issue in Linux. I have not tested a Mac. The values reported in Windows are too large by as much as 58%. Searching online seems to indicate that the issue is some applications in Windows are "dpi aware"; unfortunately, none of the so-called work-arounds I've found actually fix the problem. The tkinter.Tk().winfo_screenwidth() and tkinter.Tk().winfo_screenheight() functions, reporting their results in pixels, appear to be correct. A MWE is simply

import tkinter
tkinter.Tk().winfo_screenmmwidth()

This reports a 508 mm on my 15.6" screen, when the true value is closer to 343 mm. This is a 48% error, and hence an unusable result. 

Thank you for your time!

----------
components: Tkinter
messages: 327265
nosy: Ackbach
priority: normal
severity: normal
status: open
title: Python 3 tkinter measurement problem
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34918>
_______________________________________


More information about the New-bugs-announce mailing list