[Tkinter-discuss] 4k HiDPI displays and tkinter
E Paine
xepaine13 at gmail.com
Mon Jul 12 15:31:57 EDT 2021
> - all widths like borderwidths, decorations, separators etc, set in
> pixels do not scale with the dpi settings. Could we use "mm" for their
> settings instead?
Definitely! The defaults in Tk use pixels, but you can use mm for lengths:
tk.Label(root, text="foo", borderwidth="5mm", relief="groove")
> - checkbox, radiobox the indicator appears tiny wrt the text
This may be related to https://bugs.python.org/issue41969, in which case
you're just waiting for your repos to update Tk.
> Is there a way to detect from tkinter a high res display and force a
> window scaling x2 for everything?
IDLE has a `fix_scaling` method. Maybe you could use something similar? https://github.com/python/cpython/blob/da2e673c5/Lib/idlelib/run.py#L313
Hope this helped!
More information about the Tkinter-discuss
mailing list