Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scales & labels

Status
Not open for further replies.

japskar

Programmer
Feb 13, 2002
27
Hi,
I'm fumbling around with scales, and I was wondering how I can place a label on the slider's drag button with the scale's current value.

I think it has something to do with trapping the scale's new value and feeding it as content to my label, which also needs an update for its place.
Can anyone help me, since I don't have any experience with this (yet).

Best regards,
Jasper van Dijk
 
When you set up the scale, say $w.scale, you give its label a value, say "0". Then, whenever you want to change the label, use:
$w.scale configure -label $newvalue
update

That should work. Bob Rashkin
rrashkin@csc.com
 
Have you tried setting the scale's -showvalue option to 1 (True)? This causes the scale to automatically display a label by the slider showing the current value of the scale. No variable tracing, etc. required. (By the way, the default for this setting is True.) - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Yes, I've tried the showvalue, and helps me for now, but that's not exactly what I want. Especially when I want to use the showvalue on a Mouse-Enter event on small vertical scales. Because the showvalue causes a shift in the slider's position, it's impossible the grab the slider without triggering the mouse-leave event (which in turn sets showvalue to 0).

So I guess I'll be tracing variables after all.

Help still most welcome.

Best regards,
Jasper van Dijk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top