Assigning a Callback

As usual, use the -command option to assign a callback for the widget. The callback is invoked every time the Scale value is changed. If you change the value from 50 to 100 and the Scale increment is 1, the callback will be invoked 50 times. The callback is also called when the widget is created. My recommendation is not to use -command unless you have a small number of possible values.

Get Mastering Perl/Tk now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.