Displaying Value Increments

The Scale displays its current value above or to the left of itself (depending on the value associated with -orient). Suppose you want to display labels (such as 0, 10, 20, ... 100) that show the user approximately where the button needs to be to select those values. If you want to display them underneath or to the left of the Scale, you can use the -tickinterval option. By default, it is set to 0 and no numbers are displayed. To show the values every 10 numbers, use -tickinterval => 10. The larger the range of values from which the Scale can select, the larger the value this should be, or you’ll end up with a bunch of numbers so close together that you won’t be able to tell what they are. See Figure 10-4.

Using -tickinterval with both horizontal and vertical Scales

Figure 10-4.  Using -tickinterval with both horizontal and vertical Scales

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.