Tk Source Code

View Ticket
Login
Ticket UUID: 220265
Title: A Tcl command invokes whenever a mouse pointer enter the scale widget without changing the value of the variable.
Type: Bug Version: final: 8.2.3
Submitter: welch Created on: 2000-10-31 23:01:05
Subsystem: 15. [scale] Assigned To: nobody
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2001-03-24 05:09:35
Resolution: Invalid Closed By: dgp
    Closed on: 2001-03-23 22:09:35
Description:
OriginalBugID: 3908 Bug
Version: 8.2.3
SubmitDate: '1999-12-20'
LastModified: '2000-01-14'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: ericm
RelatedBugIDs: 6339
OS: Linux-Red Hat
OSVersion: RedHat 5.0
ClosedDate: '2000-01-14'


Name:
Josephine Ng

Extensions:
Tcl/Tk

Comments:
The script is tested on both Tcl8.02p and Tcl8.2.3 on both windows 95 and Linux.
While the script doesn't behave as expected in Linux, it behaves correctly in Windows 95.

ReproducibleScript:
set bandtest [scale .bt -orient horizontal  -from 410.8 -to 956.1  -resolution 0.1  -length 128 -width 5 -tickinterval [expr 956.1 - 410.8]  -digits 4 -showvalue 1 -troughcolor blue -command updateBandTest"]
pack $bandtest

proc updateBandTest { value } {
    puts "updateBandTest!! $value"

}

ObservedBehavior:
The Tcl command will be invoked whenever the mouse pointer enter the scale widget without pressing
any buttons of the mouse.

DesiredBehavior:
The Tcl command should only be invoked when the mouse button is pressed over the slider.



This is verifed with 8.3b1 on Linux.  It does not occur on Windows
or Solaris, so this seems to be Linux only at the moment (RH6). 
-- 12/22/1999 hobbs

Minimal case:

--------------------------------
proc foo {val} {puts "foo $val"}
pack [scale .s -resolution 0.1 -command foo]
.s set 0.3
--------------------------------

- eric

-- 01/13/2000 ericm

This seems to be a compiler bug.  On a sample RH 6.0 Linux install (which uses egcs-2.91.66), I found that adding diagnostic "printf" calls to the TkpSetScaleValue funciton in tkUnixScale.c made the problem go away.  Then I found that compiling the original code with neither optimization nor debugging enabled also made the problem go away.  These are classic signs of a C compiler bug.

- eric

-- 01/13/2000 ericm 
-- 01/14/2000 ericm