RosettaCodeData/Task/Simple-windowed-application/Perl/simple-windowed-application-1.pl

11 lines
261 B
Perl
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
use Tk;
$main = MainWindow->new;
$l = $main->Label('-text' => 'There have been no clicks yet.')->pack;
$count = 0;
$main->Button(
-text => ' Click Me ',
-command => sub { $l->configure(-text => 'Number of clicks: '.(++$count).'.'); },
)->pack;
MainLoop();