I am using tk module to build a checklist for user to choose. I am totally beginner to this module. Currently the checklist created is all in the same series column, since it will be a long list, any idea how could I separate few of the options to another column? Also, any idea how to align those text to the left while checkbox to the right? To display it cleanly and neatly.

#!/usr/bin/perl use Tk; $main = MainWindow->new(); $label = $main->Label(-text => "Presence Check"); $label->pack(); $frame = $main->Frame(-relief=>"groove", -borderwidth=>2); #$frame = $main->Frame(-relief=>"groove", -borderwidth=>2)->pack(-side + => 'top', -expand => 1, -fill =>'both'); #$frame = $main->Frame->pack(-side => 'left', -fill => 'x'); $check1 = $frame->Checkbutton(-text=>"Document A (docx, pdf)", -variable=>\$a, -onvalue=>"APRESENT", -offvalue=>"AABSENT"); #$check1->pack(-side=>"top"); $check2 = $frame->Checkbutton(-text=>"Document B (xlsx)", -variable=>\$b, -onvalue=>"BPRESENT", -offvalue=>"BABSENT"); $check2->pack(-side=>"top"); $check3 = $frame->Checkbutton(-text=>"C specification", -variable=>\$c, -onvalue=>"CPRESENT", -offvalue=>"CABSENT"); $check3->pack(-side=>"top"); $check4 = $frame->Checkbutton(-text=>"A-Specification", -variable=>\$aspec, -onvalue=>"ASPECPRESENT", -offvalue=>"ASPECSABSENT"); $check4->pack(-side=>"top"); $check5 = $frame->Checkbutton(-text=>"Important Report", -variable=>\$report, -onvalue=>"REPORTPRESENT", -offvalue=>"REPORTSABSENT"); $check5->pack(-side=>"top"); $check6 = $frame->Checkbutton(-text=>"Handbook", -variable=>\$handbook, -onvalue=>"HANDBOOKPRESENT", -offvalue=>"HANDBOOKABSENT"); $check6->pack(-side=>"top"); $check7 = $frame->Checkbutton(-text=>"Data Spreadsheet", -variable=>\$dataxls, -onvalue=>"DATAPRESENT", -offvalue=>"DATAABSENT"); $check7->pack(-side=>"top"); $check8 = $frame->Checkbutton(-text=>"D file", -variable=>\$dfile, -onvalue=>"DFILEPRESENT", -offvalue=>"DFILEABSENT"); $check8->pack(-side=>"top"); $check10 = $frame->Checkbutton(-text=>"xx doc", -variable=>\$xxdoc, -onvalue=>"XXDOCPRESENT", -offvalue=>"XXDOCABSENT"); $check10->pack(-side=>"top"); $check18 = $frame->Checkbutton(-text=>"yy Doc", -variable=>\$yydoc, -onvalue=>"YYDOCPRESENT", -offvalue=>"YYDOCABSENT"); $check18->pack(-side=>"top"); $frame->pack(); $button = $main->Button(-text => "Exit", -command => \&exit_button); $button->pack(); MainLoop(); sub exit_button { print "$a $b $c $aspec $report $handbook $dataxls $dfile $xxdoc $yydoc + \n"; #print "$rv\n"; exit, }

In reply to PERL tk module handling by michael99

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.