Tk Library Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: 3295abf0786394dc8bb96ecadc30ce4a57e6af0e
Title: ico: incorrect use of $img put
Type: Bug Version: trunk
Submitter: anonymous Created on: 2017-01-09 17:31:11
Subsystem: tklib :: ico Assigned To: aku
Priority: 8 Severity: Important
Status: Open Last Modified: 2017-01-10 06:51:21
Resolution: None Closed By: nobody
    Closed on:

In the ico module there are the following four lines:

/tklib-0.6/modules/ico/ico.tcl(557):	$img put -to 0 0 $colors
/tklib-0.6/modules/ico/ico.tcl(563):    $img put -to $x $y $clr
/tklib-0.6/modules/ico/ico0.tcl(400):	$img put -to 0 0 $colors
/tklib-0.6/modules/ico/ico0.tcl(406):	$img put -to $x $y $clr

This is an incorrect use of the put command. Documentation says:

imageName put data ?option value(s) ...?

However the code in the ico module uses:

imageName put ?option value(s) ...? data

The latter used to be accepted, although undocumented, but will soon no longer be. See:

Fix is easy and consists in swapping the order of the data and the options arguments.