#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = new MainWindow; $mw->geometry("360x250+280+60"); $mw->bind('<Escape>' => sub {exit;}); $mw->configure(-title => 'Test Checkbox Alignment'); my ($qv, $dg, $yb, $pv, $rd, $oc, $hr, $tm); ################################################################### # Create frame for 4th set of check boxes. ################################################################### my $frame_cb0 = $mw->Frame; $frame_cb0->pack(-side => "bottom", -pady => 1); ################################################################### # Create first check box for 4th set. ################################################################### my $qv_cbox = $frame_cb0->Checkbutton( -text => 'QuickCheck', -variable => \$qv, ); $qv_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create second check box for 4th set. ################################################################### my $dg_cbox = $frame_cb0->Checkbutton( -text => 'Systems Guide', -variable => \$dg, ); $dg_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create frame for 3rd set of check boxes. ################################################################### my $frame_cb1 = $mw->Frame; $frame_cb1->pack(-side => "bottom", -pady => 1); ################################################################### # Create first check box for 3rd set. ################################################################### my $yb_cbox = $frame_cb1->Checkbutton( -text => 'Study', -variable => \$yb, ); $yb_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create second check box for 3rd set. ################################################################### my $pv_cbox = $frame_cb1->Checkbutton( -text => 'Analyze', -variable => \$pv, ); $pv_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create frame for 2nd set of check boxes. ################################################################### my $frame_cb2 = $mw->Frame; $frame_cb2->pack(-side => "bottom", -pady => 1); ################################################################### # Create first check box for 2nd set. ################################################################### my $rd_cbox = $frame_cb2->Checkbutton( -text => 'Read', -variable => \$rd, ); $rd_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create second check box for 2nd set. ################################################################### my $oc_cbox = $frame_cb2->Checkbutton( -text => 'Configure', -variable => \$oc, ); $oc_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create frame for 1st set of check boxes. ################################################################### my $frame_cb3 = $mw->Frame; $frame_cb3->pack(-side => "bottom", -pady => 1); ################################################################### # Create first check box for 1st set. ################################################################### my $hr_cbox = $frame_cb3->Checkbutton( -text => 'Troubleshoot', -variable => \$hr, ); $hr_cbox->pack( -side => "left", -anchor => 'w', ); ################################################################### # Create second check box for 1st set. ################################################################### my $tm_cbox = $frame_cb3->Checkbutton( -text => 'Prioritize', -variable => \$tm, ); $tm_cbox->pack( -side => "left", -anchor => 'w', ); MainLoop; exit;
"Its not how hard you work, its how much you get done."
In reply to Aligning Tk Checkboxes by roho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |