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

11 lines
261 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04: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();