programming-examples/perl/GUI/Using Scale control.pl
2019-11-15 12:59:38 +01:00

26 lines
455 B
Perl

use Tk;
$main = MainWindow->new();
$main->Scale('-orient'=> 'horizontal',
'-from' => 0,
'-to' => 200,
'-tickinterval' => 40,
'-label' => 'Select a value:',
'-length' => 200,
'-variable' => \$value,
'-command' => \&display
)->pack;
$text1 = $main->Text ('-width'=> 40,
'-height' => 2
)->pack;
sub display
{
$text1->delete('1.0','end');
$text1->insert('end', "$value");
}
MainLoop;