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.
Get Mastering Perl/Tk now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.