in reply to A logarithmic Tk:Scale widget?
(updated to show the resulting scale value in the Tk window, rather than on stdout)#!/usr/bin/perl use Tk; $m=MainWindow->new(-title => "test"); $m->Button(-command => sub{exit(0)}, -text => "Bye")->pack; my $scale_value_str = " current scale value = "; $m->Label(-textvariable => \$scale_value_str)->pack; $m->Scale(-from => -2, -to => 2, -digits => 0, -resolution => -1, -command=>sub{$scale_value_str=sprintf " current scale = %8. +3f ",10**$_[0]} )->pack; MainLoop;
|
|---|