python / cpython

The Python programming language
https://www.python.org/
Other
61.18k stars 29.53k forks source link

IDLE uses incorrect screen dimension units #120104

Open serhiy-storchaka opened 1 month ago

serhiy-storchaka commented 1 month ago

In two places IDLE uses incorrect unit for screen dimension: https://github.com/python/cpython/blob/983efcf15b2503fe0c05d5e03762385967962b33/Lib/idlelib/configdialog.py#L114 https://github.com/python/cpython/blob/983efcf15b2503fe0c05d5e03762385967962b33/Lib/idlelib/searchbase.py#L89

It uses "5px", but the only documented valid suffixes are "c", "i", "m" and "p". Tk ignores the rest in versions < 8.7, but in 8.7 and 9.0 this is an error. And this is for good, because "px" did not mean pixels, as was expected, but printer's points (1/72 inch).

If we want to keep the same look, we should change "px" to "p". But if it originally should be in pixels, we should remove the suffix. In all other places padding is specified in pixels, and this makes sense, so I believe the latter option is better.

Linked PRs

terryjreedy commented 1 month ago

Both of those are ttk Frames PRs originally authored by Mark Roseman in 2020 for issue #78168. I would prefer consistently using pixels. I will check later to see the effect of just removing 'p' and if I prefer (as I suspect) increasing the number.