Tk Library Source Code

View Ticket
Login
Ticket UUID: 1c877f89a4987ff04f25dbf50e8fd57c92dd93a2
Title: controlwidget: voltmeter, meter and thermometer fail with Tk 9 when the size is a screen distance
Type: Bug Version: trunk
Submitter: serhiy.storchaka Created on: 2026-11-15 23:57:43
Subsystem: tklib :: controlwidget Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-11-15 23:57:43
Resolution: None Closed By: nobody
    Closed on:
Description:

With Tk 9, controlwidget::voltmeter .v fails with cannot use non-numeric string "50m", and controlwidget::meter .m fails with invalid bareword "2i". The thermometer fails the same way when -width or -height is given as a screen distance, e.g. -height 2i.

The widgets use cget -width and cget -height of their canvas in computations. Tk 8.6 returned them in pixels, but since Tk 9.0 they are returned as given (Tk ticket 610a73a179). The tachometer has the same problem, see [b845a924db].

Proposed fix in branch controlwidget-tk9-screen-distances.