Repository navigation
Document idlelib.util.fix_win_hidpi() #159139
Description
Activity
- changed the title
[-]Document `idlelib.util.fix_win_hidpi`[/-][+]Document `idlelib.util.fix_win_hidpi()`[/+]on Oct 10, 2026 I’d like to investigate this documentation improvement. Since
idlelibis described as an implementation package, shouldfix_win_hidpi()be documented in the IDLE developer documentation, or is the intention to make it discoverable as a utility for Tkinter applications? I’ll check the existing documentation structure before proposing a change.Reacted by CbscfeI think the win_hidpi fix should be in tkinter itself or even python. When Steve Dower gave me the fix (pretty much as written), we briefly discussed the possibility. As I remember, there are 3 options for the parameter passed and the proper value might depend on details of what Python itself does. So it might be that tkinter should always do the fix on Windows, before the first tk operation. If not, it could give users the option to set it immediately after import. The font, word-break, and x11 paste fixes are also not IDLE specific.
When we implemented PEP-434, clarifying the status of idlelib, we discussed documenting a few functions or classes for public use and decided not to. However, the IDLE doc has a section Developing Tkinter Applications. Pending a move to tkinter, I might accept something like the following. (But would anyone ever look here?)
Idlelib.util has some short, private 'fix_x' functions that address tk issues with high dpi monitors and cross-compatibility.
If useful for other tkinter applications, they can be copied into their source tree.If such lines becomes obsolete, they could be changed to refer to tkinter or removed.
To make reading util.py clearer, regardless a doc note, the current fix_x comment should be expanded to something like:
# The following fix_x functions address tk shortcomings on hidpi monitors and cross-system compatibility. # They should each be applied once per process.Also, the issue numbers should be labed 'gh-' after making sure that they are not bpo numbers.
Comments?
Reacted by CbscfeThis is a spinoff of #119459, where this was mentioned. I mentioned the possibility of doing something there.
Comments?i guess i see......
should close?I will at least change the comment and issue references in util.py.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsTodo
Documentation
I see a lot of people having problems with windows's high dpi problem on tkinter,
and I just discovered minutes ago that this undocumented function exists and can solve the issue,
I wish It could be documented ()
qwq