#!/usr/bin/perl use strict; use warnings; use Tk; my $window = MainWindow->new(); $window->title('test'); my $fo = $window->Frame()->pack(-side => 'top', -expand => 1, -fill => 'both', ); my $f1 = $fo->Frame(-borderwidth => 3, -relief => 'groove', ) ->pack(-side => 'left', -expand => 1, -fill => 'both', ); $f1->Label(-text=>'Uhrzeiten')->pack(); my $stunde1 =0; my $stunde2 =0; $f1->Checkbutton(-text => "Stunde 1",-variable=>\$stunde1)->pack(); $f1->Checkbutton(-text => "Stunde 2",-variable=>\$stunde2)->pack(); $window->Button(-text=>'OK',-command=>sub{ print $stunde1, print $stunde2, }, )->pack(); MainLoop();