Hi Monks, I want to copy all the contents of one column of the table and paste it to the other column of the table, created in Perl/Tk. I also want to copy the contents of one column by dragging the mouse only. Code Snippet is as follows:
#!/usr/local/bin/perl use Tk; use Tk::Table; use Tk::Entry; $mw = new MainWindow; $title = $mw -> title("kapsule"); $show_table_frame = $mw->Frame()->pack(-side => "top",-fill => "both" +,-anchor => "nw",-padx=>"10"); $button = $mw-> Button(-text=>"show",-font => "verdanafont 10 bold",- +command=>sub { if ($show_table_frame ->ismapped) { $show_table_frame ->packForget(); } else { $show_table_frame ->pack(); } } )->pack(); $show_table = $show_table_frame->Table(-columns => 3,-rows => + 5,-scrollbars => "o",-fixedrows => 1,-fixedcolumns => 0,-relief => 'raised',-takefocus=>"0",-pady=>"5"); $tmp_label = $show_table->Label(-text => "Col. 1 ", -width => + 15, -relief =>'ridge'); $show_table->put(0, 1, $tmp_label); $tmp_label = $show_table->Label(-text => "Col. 2", -width => +15, -relief =>'ridge'); $show_table->put(0, 2, $tmp_label); $tmp_label = $show_table->Label(-text => "col. 3", -width => +15, -relief =>'ridge'); $show_table->put(0, 3, $tmp_label); for($col=1;$col<4;$col++) { for ($row=1;$row<5;$row++) { $ent = $show_table -> Entry(-font=>"verdana 10") -> + pack(-ipady=>"15"); $show_table->put($row,$col,$ent); } } $show_table->pack(); MainLoop;
Please help me in achieving this. Thanks in advance

In reply to Perl/Tk: How to select all and copy/paste all contents of one column of a table ? by kapsule

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.