Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: [Tkinter-discuss] Please help -- Tkinter Scale widget withDoubleVar is acting weird

Reply
Thread Tools

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

 
 
Jeff Epler
Guest
Posts: n/a
 
      08-23-2004
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+1Jd01MZaTXX0RAugfAJ0XulAbpUnkRvCUq4yEDs 2Z3bjysACeNePo
N4hYLCylJal/Xm1qL/md31w=
=TKT2
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch Python 0 07-08-2012 09:19 PM
Is there a Tkinter widget like Scale with two sliders? WLigtenberg@gmail.com Python 0 11-20-2007 09:08 AM
Re: [Tkinter-discuss] Please help -- Tkinter Scale widget withDoubleVar is acting weird Jeff Epler Python 0 08-20-2004 12:07 PM
Re: Please help -- Tkinter Scale widget with DoubleVar is actingweird Fredrik Lundh Python 0 08-19-2004 05:01 PM
Tkinter, scale widget, and mouse clicks John Fouhy Python 2 06-25-2004 12:49 AM



Advertisments