#!/usr/local/bin/perl use Tk; use Tk::Table; use Tk::Entry; my $mw = new MainWindow; my $title = $mw -> title("kapsule"); my $button = $mw-> Button(-text=>"show",-font => "verdanafont 10 bold" +,-command=>\&show_table)->pack(-side=>"top",-anchor => "w",-pady=>"15",-padx=>"5"); MainLoop; sub show_table() { if (!Exists($show_table_frame)) { our $show_table_frame = $mw->Frame()->pack(-side => "top",-fil +l => "both",-anchor => "nw",-padx=>"10"); our $show_table = $show_table_frame->Table(-columns => 3,-rows + => 5,-scrollbars => "o",-fixedrows => 1,-fixedcolumns => 0,-relief => 'raised',-takefocus=>"0",-pady=>"5"); my $tmp_label = $show_table->Label(-text => "Col. 1 ", -width +=> 15, -relief =>'ridge'); $show_table->put(0, 1, $tmp_label); my $tmp_label = $show_table->Label(-text => "Col. 2", -width = +> 15, -relief =>'ridge'); $show_table->put(0, 2, $tmp_label); my $tmp_label = $show_table->Label(-text => "col. 3", -width = +> 15, -relief =>'ridge'); $show_table->put(0, 3, $tmp_label); for($row=1;$row<5;$row++) { for ($col=1;$col<4;$col++) { my $ent = $show_table -> Entry(-font=>"verdana 10") + -> pack(-ipady=>"15"); $show_table->put($row,$col,$ent); } } $show_table->pack(); } else { $show_table_frame->destroy(); } }
here is the code with which i am facing problem, i have tried pack and pack forget also.

In reply to Re^2: Perl/Tk:swapping of frames without loosing the data by kapsule
in thread Perl/Tk:swapping of frames without loosing the data by Anonymous Monk

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.