in reply to Tk::Table hide?

Have you searched the CPAN POD? Have you googled?

Where have you looked? What have you tried? Are you asking the right question? Sometimes saying what you're trying to do is more effective than asking about a particular function, because it may end up that there's another way to achieve your goal than what you think.

Replies are listed 'Best First'.
Re^2: Tk::Table hide?
by Ohad (Novice) on Jul 12, 2010 at 12:11 UTC
    Hi,

    I want to create a table in Perl Tk, that will support sort and filtering.

    Currently I implemented the table using Tk::Table. This is the table code:
    my @lines = (<Tab>); chomp(@lines); close(Tab); my @tmp = (split(/;/,$lines[0])); my $colu = ($#tmp) +2; my $ro = ($#lines+2); $table->destroy if ($table); $table = $TFrame->Table(-rows=>$ro, -columns=>$colu, - +scrollbars=>'se', -fixedrows=>2, -relief=>'raised')->pack(-side=>'top +',-anchor=>'nw'); my $r =1; my @Approved =0; foreach my $row (@lines) { my $tmp_l; if ($r>1) { my $data = $r -1; $tmp_l = $table->Label(-text=>$data, -anchor=> +'w', %Entry_color, -relief=>"groove"); $table->put($r, 1, $tmp_l); } else { $tmp_l = $table->Label(-text=>"Entry", -anchor +=>'w',-background=>'gray', -relief=>"raised"); $table->put($r, 1, $tmp_l); } my $c=2; my @data = (split(/;/,$row)); while ($c <= $colu) { if ($data[$c-2]) { $file_Contant[$r-1][$c-2]=$data[$c-2] ; } else { $file_Contant[$r-1][$c-2]=""; } my $tmp_label; if ($r==1) { $tmp_label = $table->Label(-text=>$data[$c +-2], -anchor=>'w',-background=>'gray', -relief=>"raised") ; + } $tmp_label = $table->Entry(-textvariable => \$ +file_Contant[$r-1][$c-2], -width=> 15,%Entry_color, -relief=>"groove" +) if ($r>1); $table->put($r, $c, $tmp_label); $c++; } $r++; } $table->pack(-fill=>'both',-side=>'top',-anchor=>'nw', +-expand=>1); return($table,\@file_Contant) }

    I want to create filtering according to columns.

      I mean e.g. filtering "Perl" in column 8, then show all rows that has "Perl" in column 8, only. I did google, and looked at the CPAN.