Here is a basic Spinbox example.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::Spinbox;
#see also JComboBox
my $mw = MainWindow->new;
$mw->title("Spinner");
$mw->fontCreate('big',
-family=>'courier',
-weight=>'bold',
-size=> 24);
my $sp1 = $mw->Spinbox(-width => 2,
-font => 'big',
-command => sub{ &show_set },
-value => [0..23])->pack (-side=>'left');
$mw->Label(-text=>":")->pack (-side=>'left');
my $sp2 = $mw->Spinbox(-width => 2,
-font => 'big',
-command => sub{ &show_set },
-value => [0..59])->pack (-side=>'left');
MainLoop;
###########################
sub show_set{
print "@_\n";
}
|