examples/tiny
raw| 1 | #!/usr/local/bin/perl -w |
| 2 | use strict; |
| 3 | use Tk; |
| 4 | use Tk::widgets qw(Button); |
| 5 | #use Carp (); |
| 6 | #$SIG{'__DIE__'} = \&Carp::confess; |
| 7 | |
| 8 | my $mw = MainWindow->new(); |
| 9 | $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack; |
| 10 | $mw->Button(-text => 'Exit', -command => sub { exit } )->pack; |
| 11 | MainLoop; |
| 12 |