Menu

#1652 Entry/Leave events cause variable writes

obsolete: 8.4.13
closed-fixed
6
2006-06-14
2004-02-05
Al Larson
No

I've report a similiar problem, which was LINUX specific
and eventually blamed on the compiler. This time, it
occurs on multiple platforms.

If a trace is set up to watch writes to a variable, and
the variable is also used as the -variable parameter to a
scale widget, the variable gets written, even though it's
contents remains unchanged, during Leave and Enter
events (NOTE: Depends on value, for example 3.5 is OK,
but 3.4 causes a variable write on all Leave/Enters)

I've attached an example.

Discussion

  • Al Larson

    Al Larson - 2004-02-05

    Demonstrates Problem

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-02-05
    • milestone: 231644 --> 352720
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-02-05
    • priority: 5 --> 6
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-02-05

    Logged In: YES
    user_id=72656

    Confirmed on WinXP with 8.4.5 - 3.5 OK, 3.4 causes write on
    enter/leave.

     
  • Don Porter

    Don Porter - 2004-02-06

    Logged In: YES
    user_id=80530

    just a note that similar issues
    in the past have come down to
    numeric precision issues in
    TkRoundToResolution.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-03-31
    • milestone: 352720 --> obsolete: 8.4.13
    • assigned_to: hobbs --> dgp
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-03-31

    Logged In: YES
    user_id=72656

    OK, I think we can chalk this one up to TkRoundToResolution,
    but what to do about it? You can very easily see why the
    problem exists here:

    (tk85d) 2 % set tcl_precision 17
    17
    (tk85d) 3 % expr 3.5-0.1
    3.3999999999999999
    (tk85d) 4 % expr 3.6-0.1
    3.5

    So when we internally store "3.4" into the scale value as a
    double, it's not /really/ 3.4, so each time we "Round" it,
    it is seen as changed.

    This affects 8.4.13 and 8.5a4.

     
  • Don Porter

    Don Porter - 2006-06-14
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2006-06-14

    Logged In: YES
    user_id=80530

    committing attached patch
    for 8.4.14 and 8.5a5

     
  • Don Porter

    Don Porter - 2006-06-14