Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE uses incorrect screen dimension units #120104

Open
Tracked by #104568
serhiy-storchaka opened this issue Jun 5, 2024 · 2 comments · May be fixed by #122740
Open
Tracked by #104568

IDLE uses incorrect screen dimension units #120104

serhiy-storchaka opened this issue Jun 5, 2024 · 2 comments · May be fixed by #122740
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jun 5, 2024

In two places IDLE uses incorrect unit for screen dimension:

self.frame = frame = Frame(self, padding="5px")

self.frame = Frame(top, padding="5px")

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

@serhiy-storchaka serhiy-storchaka added 3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Jun 5, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jun 5, 2024
@terryjreedy
Copy link
Member

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.

@terryjreedy
Copy link
Member

Since pixels are smaller than points, the result is slightly smaller padding in various places, but it looks fine to me. So I will leave the patch as is.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 6, 2024
…onGH-120107)

(cherry picked from commit 4b66b6b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 6, 2024
…onGH-120107)

(cherry picked from commit 4b66b6b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
terryjreedy pushed a commit that referenced this issue Aug 6, 2024
…120107) (#122741)

(cherry picked from commit 4b66b6b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed 3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants