use strict; use warnings; use Tk; my $shiftselect; ########################### ## Make Main Window my $mw = MainWindow->new (-title => 'opzTul'); $mw->resizable('false','true'); # (menu bar left out for brevity) my $grid = $mw->Frame()->pack; my $All = $grid->Radiobutton(-text => 'All day', -variable => \$shiftselect, -value => 'All' ); my $goButton = $grid->Button(-text => 'Go!', -width => 27, -command => sub {print "Go\n"} ); my $refButton = $grid->Button (-text => 'Refresh', -width => 27, -command => sub {print "Refresh\n"} ); my $quitButton = $grid->Button (-text => 'Quit', -width => 27, -command => \&quit ); ########################### ## Pack and build all elements of the window $All -> grid (-row => 2, -columnspan => 4, -sticky => 'n', -pady => 5, -padx => 5,); $goButton->grid (-row => 3, -columnspan => 4, -sticky => 'n', -pady => 5, -padx => 5, ); $refButton -> grid (-row => 4, -columnspan => 4, -sticky => 'n', -padx => 2, -pady => 2); $quitButton -> grid (-row => 6, -columnspan => 4, -sticky => 'n', -padx => 2, -pady => 2); MainLoop; sub quit { print "Quitting ..\n"; $mw -> destroy; }