Book HomeMastering Perl/TkSearch this book

10.4. 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.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.