Re: [Tkinter-discuss] Please help -- Tkinter Scale widget withDoubleVar is acting weird

Discussion in 'Python' started by Jeff Epler, Aug 23, 2004.

  1. Jeff Epler

    Jeff Epler Guest

    I looked into this some more, and was able to reproduce the problem
    using
    tcl-8.3.5-88
    redhat-release-9-3
    I was then also able to demonstrate it on tcl/tk 8.5.

    I used this wish script:
    scale .s -variable v -resolution 0.1 -from 0 -to 1
    trace variable v w changed
    proc changed {args} { global v; puts "v changed. new value: $v" }
    pack .s

    I set the scale value to 0.7. Now, by moving the cursor *between the
    slider and the trough*, I get the repeated message "v changed. new value:
    0.7". (It's the movement between slider and trough, not just hovering,
    that made the redundant sets happen for me)

    This behavior doesn't seem to depend on the value of tcl_precision.

    It *looks* like the problem is in TkRoundToResolution(). It returns
    a slightly different value than the incoming value, so that the test
    "scalePtr->value == value" in tkUnixScale:TkpSetScaleValue() fails and
    it falls through to a Tcl_SetVar call. This is low-level stuff inside
    of tk. Like Fredrik suggested, your next step is to go to the tcl/tk
    community with your report, if it's important to you.

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQFBKf+1Jd01MZaTXX0RAugfAJ0XulAbpUnkRvCUq4yEDs2Z3bjysACeNePo
    N4hYLCylJal/Xm1qL/md31w=
    =TKT2
    -----END PGP SIGNATURE-----
     
    Jeff Epler, Aug 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Fouhy
    Replies:
    2
    Views:
    622
    John Fouhy
    Jun 25, 2004
  2. Fredrik Lundh
    Replies:
    0
    Views:
    516
    Fredrik Lundh
    Aug 19, 2004
  3. Jeff Epler
    Replies:
    0
    Views:
    527
    Jeff Epler
    Aug 20, 2004
  4. Replies:
    0
    Views:
    302
  5. Frederic Rentsch
    Replies:
    0
    Views:
    266
    Frederic Rentsch
    Jul 8, 2012
Loading...

Share This Page