programming-examples/perl/GUI/Link a subroutine with a button action.pl
2019-11-15 12:59:38 +01:00

17 lines
393 B
Perl

#!/usr/local/bin/perl -w
use Tk;
use strict;
my %info;
my $mw = MainWindow->new;
$mw->title("Data Entry");
my $f = $mw->Frame->pack(-side => 'bottom');
$f->Button(-text => "Exit",
-command => sub { exit; })->pack(-side => 'left');
$f->Button(-text => "Save",
-command => sub {
print "asdf";
})->pack(-side => 'bottom');
MainLoop;