O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Minimum and Maximum Values

Use the -from and -to options to change the possible range of values for the Scale. Usually the value associated with -from is smaller than the value associated with -to. If you happen to switch them, the Scale will still display the higher value on the right and the lower value on the left. Either or both values can be negative. Here are some examples:

$mw->Scale(-from => -10, -to => 10)->pack;
$mw->Scale(-from => 10, -to => -100)->pack;
$mw->Scale(-from => -100, -to => -50)->pack;
$mw->Scale(-from => -0.5, -to => 0.5, -resolution => 0.1)->pack;

As you can see, the values assigned to -from and -to don’t need to be integers.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required