Tk Source Code

View Ticket
Login
Ticket UUID: 601cead1d05b0d641f653e0b51436db2134f5026
Title: Tk on Windows does not scale widgets on high resolution displays
Type: Bug Version: 8.6.4
Submitter: anonymous Created on: 2015-05-11 13:39:14
Subsystem: 02. Appearance Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2020-05-29 02:00:28
Resolution: Fixed Closed By: bll
    Closed on: 2020-05-29 02:00:28
Description:

This is my test script:

package require Tk
pack [frame .root -padx 10mm -pady 10mm] -fill both -expand 1
pack [checkbutton .root.cb -text "Check me"]
pack [frame .root.rb]
for {set i 0} {$i < 3} {incr i} {
        pack [radiobutton .root.rb.rb$i -variable rb -value $i -text "Select $i"]
}
.root.rb.rb0 select
pack [label .root.lb -image [image create photo -file available.gif] -text "Image label" -compound left]
set input "Input text..."
pack [entry .root.e -textvariable input]

I'm running it on Hi-DPI display in Windows and OSX, and see different results: https://www.dropbox.com/s/wq2kyf0wfwfdo7b/hidpi-tk-osx.png?dl=0 and https://www.dropbox.com/s/k5a3bn2cieknmne/hidpi-tk-windows.png?dl=0

So Tk under OSX uses correctly sized radiobuttons and checkbuttons, and scale image automatically. When Windows version scale fonts, but not all widgets (entry is scaled well) and not images.

I think Windows Tk behavior should match OSX one. For example, PuTTY screenshot with correctly sized widgets: https://www.dropbox.com/s/2l89qw4azcpcfrd/putty.png?dl=0

User Comments: bll added on 2020-05-22 17:36:23:
See: https://core.tcl-lang.org/tk/info/3c6660b6f0bed337

sergiol added on 2017-12-13 00:29:23:
It seems to me `SetProcessDpiAwareness` is a thing we should invest some time, to see if it works:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122(v=vs.120).aspx

anonymous added on 2015-05-25 03:38:43:
Duplicate of [0917069c05]?

anonymous added on 2015-05-18 14:33:54:
the problem is the same with ttk widgets (they also a bit blurry)

apnadkarni added on 2015-05-18 11:41:30:
Generally ignorant of such matters, but you might possibly have better luck with the ttk widgets (ttk::checkbutton etc.) as I think they use more of the native controls. Might be worth a shot.