~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to Tk/Table.pm

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 1995-1999 Nick Ing-Simmons. All rights reserved.
 
1
# Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
2
2
# This program is free software; you can redistribute it and/or
3
3
# modify it under the same terms as Perl itself.
4
4
package Tk::Table;
5
5
use strict;
6
6
 
7
7
use vars qw($VERSION);
8
 
$VERSION = '3.020'; # $Id: //depot/Tk8/Tk/Table.pm#20 $
 
8
$VERSION = '3.024'; # $Id: //depot/Tk8/Tk/Table.pm#24 $
9
9
 
10
10
use Tk::Pretty;
11
11
use AutoLoader;
164
164
 my $why   = $t->{LayoutPending};
165
165
 $t->{LayoutPending} = 0;
166
166
 
167
 
 if ($sb =~ /^[ns]/)
 
167
 if ($sb =~ /[ns]/)
168
168
  {
169
169
   $t->{xsb} = $t->Scrollbar(-orient => 'horizontal', -command => ['xview' => $t]) unless (defined $t->{xsb});
170
170
   $xsb   = $t->{xsb};
171
171
   $xs[3] = $xsb->ReqHeight;
172
 
   if ($sb =~ /^n/)
 
172
   if ($sb =~ /n/)
173
173
    {
174
174
     $xs[1] = $tadj;
175
175
     $tadj += $xs[3];
185
185
   $t->{xsb}->UnmapWindow if (defined $t->{xsb});
186
186
  }
187
187
 
188
 
 if ($sb =~ /[ew]$/)
 
188
 if ($sb =~ /[ew]/)
189
189
  {
190
190
   $t->{ysb} = $t->Scrollbar(-orient => 'vertical', -command => ['yview' => $t]) unless (defined $t->{ysb});
191
191
   $ysb    = $t->{ysb};
192
192
   $ys[2]  = $ysb->ReqWidth;
193
 
   if ($sb =~ /w$/)
 
193
   if ($sb =~ /w/)
194
194
    {
195
195
     $ys[0] = $ladj;
196
196
     $ladj += $ys[2];
432
432
 if (@_ > 1)
433
433
  {
434
434
   $t->_configure(-rows => $r);
 
435
   if ($t->{Row} && @{$t->{Row}} > $r)
 
436
    {
 
437
     for my $y ($r .. $#{$t->{Row}})
 
438
      {
 
439
       for my $s (@{$t->{Row}[$y]})
 
440
        {
 
441
         $s->destroy if $s;
 
442
        }
 
443
      }
 
444
     splice @{ $t->{Row} }, $r;
 
445
    }
435
446
   $t->QueueLayout(16);
436
447
  }
437
448
 return $t->_cget('-rows');
454
465
 if (@_ > 1)
455
466
  {
456
467
   $t->_configure(-columns => $r);
 
468
   if ($t->{Row})
 
469
    {
 
470
     for my $row (@{$t->{Row}})
 
471
      {
 
472
       for my $s (@$row[$r .. $#$row])
 
473
        {
 
474
         $s->destroy if $s;
 
475
        }
 
476
       splice @$row, $r;
 
477
      }
 
478
    }
457
479
   $t->QueueLayout(16);
458
480
  }
459
481
 return $t->_cget('-columns');