examples/firebutton
raw| 1 | # Button with "repeat" effect. |
| 2 | #!/usr/local/bin/perl -w |
| 3 | use strict; |
| 4 | use Tk; |
| 5 | use Tk::FireButton; |
| 6 | |
| 7 | my $i = 0; |
| 8 | |
| 9 | my $mw = Tk::MainWindow->new(); |
| 10 | my $fb = $mw->FireButton( |
| 11 | -text=>'Fire', |
| 12 | -command=>sub{$i++;} |
| 13 | )->pack; |
| 14 | my $l = $mw->Label(-textvariable=>\$i)->pack(qw/-padx 10 -pady 6/); |
| 15 | |
| 16 | Tk::MainLoop; |
| 17 | __END__ |