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

ttk.Sizegrip disappears under Windows 10 UI Scaling, with dpiAware set true and >1 scaling #87845

Closed
msmith mannequin opened this issue Mar 31, 2021 · 2 comments
Closed
Labels
3.10 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@msmith
Copy link
Mannequin

msmith mannequin commented Mar 31, 2021

BPO 43679
Nosy @terryjreedy, @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-04-03.22:20:22.078>
created_at = <Date 2021-03-31.12:26:06.429>
labels = ['type-bug', 'expert-tkinter', '3.10']
title = 'ttk.Sizegrip disappears under Windows 10 UI Scaling, with dpiAware set true and >1 scaling'
updated_at = <Date 2021-04-03.22:20:22.077>
user = 'https://bugs.python.org/msmith'

bugs.python.org fields:

activity = <Date 2021-04-03.22:20:22.077>
actor = 'terry.reedy'
assignee = 'none'
closed = True
closed_date = <Date 2021-04-03.22:20:22.078>
closer = 'terry.reedy'
components = ['Tkinter']
creation = <Date 2021-03-31.12:26:06.429>
creator = 'msmith'
dependencies = []
files = []
hgrepos = []
issue_num = 43679
keywords = []
message_count = 2.0
messages = ['389893', '390145']
nosy_count = 3.0
nosy_names = ['terry.reedy', 'serhiy.storchaka', 'msmith']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue43679'
versions = ['Python 3.10']

@msmith
Copy link
Mannequin Author

msmith mannequin commented Mar 31, 2021

When using tkinter on Windows (10) with a >1 HiDpi screen the sizegrip disappear with dpiawareness is on. A minimal example is as follows:

import tkinter as tk
import tkinter.ttk as ttk
from ctypes import windll, pointer, wintypes
windll.shcore.SetProcessDpiAwareness(1)

root = tk.Tk()
btn1 = tk.Button(root, text='btn1').pack(side=tk.LEFT)
sg = ttk.Sizegrip(root).pack(side=tk.LEFT)
btn2 = tk.Button(root, text='btn2').pack(side=tk.LEFT, fill=tk.BOTH, expand=1)
root.mainloop()

Works fine with commented "SetProcessDpiAwareness", but not when using it. This might be related to the tk issues with hidpi and small radio/checkboxes https://bugs.python.org/issue41969

@msmith msmith mannequin added 3.7 (EOL) end of life topic-tkinter type-bug An unexpected behavior, bug, or error labels Mar 31, 2021
@terryjreedy
Copy link
Member

In bpo-33656, we determined that tcl/tk *is* dpi aware and that telling Windows so is needed for proper text display. IDLE now issues the same Windows command (idlelib.pyshell, line 20). This perhaps should be done by Python itself, but that is not my department. In any case, without the setting, text in IDLE Windows is much uglier on my 27 inch 2560 x 1440 screen.

IDLE Windows do not currently have sizegrips. This seems to be standard on Windows. One can resize by grabbing the bottom of the lower right corner. But it is a bit finicky.

When I run your code, I see the small, faint, sizegrip. Perhaps my screen is not HiDpi enough to see the problem. In any case, this is a tcl/tk issue. Perhaps upgrading to 8.6.11 (bpo-43652) will help, as it is supposed to for the radiobutton issue.

@terryjreedy terryjreedy added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Apr 3, 2021
@terryjreedy terryjreedy added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Apr 3, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant