home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D2.iso / workshop / apache / files / ActivePerl-5.6.1.638-MSWin32-x86.msi / _861c7683821d0502bb886c4168286db7 < prev    next >
Encoding:
Text File  |  2004-04-13  |  1.3 KB  |  51 lines

  1. # NOTE: Derived from blib\lib\Tk\Frame.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Frame;
  5.  
  6. #line 117 "blib\lib\Tk\Frame.pm (autosplit into blib\lib\auto\Tk\Frame\labelPack.al)"
  7. sub labelPack
  8. {
  9.  my ($cw,$val) = @_;
  10.  my $w = $cw->Subwidget('label');
  11.  my @result = ();
  12.  if (@_ > 1)
  13.   {
  14.    if (defined($w) && !defined($val))
  15.     {
  16.      $w->packForget;
  17.     }
  18.    elsif (defined($val) && !defined ($w))
  19.     {
  20.      require Tk::Label;
  21.      $w = Tk::Label->new($cw,-textvariable => $cw->labelVariable);
  22.      $cw->Advertise('label' => $w);
  23.      $cw->ConfigDelegate('label',qw(-text -textvariable));
  24.     }
  25.    if (defined($val) && defined($w))
  26.     {
  27.      my %pack = @$val;
  28.      unless (exists $pack{-side})
  29.       {
  30.        $pack{-side} = 'top' unless (exists $pack{-side});
  31.       }
  32.      unless (exists $pack{-fill})
  33.       {
  34.        $pack{-fill} = 'x' if ($pack{-side} =~ /(top|bottom)/);
  35.        $pack{-fill} = 'y' if ($pack{-side} =~ /(left|right)/);
  36.       }
  37.      unless (exists($pack{'-before'}) || exists($pack{'-after'}))
  38.       {
  39.        my $before = ($cw->packSlaves)[0];
  40.        $pack{'-before'} = $before if (defined $before);
  41.       }
  42.      $w->pack(%pack);
  43.     }
  44.   }
  45.  @result = $w->packInfo if (defined $w);
  46.  return (wantarray) ? @result : \@result;
  47. }
  48.  
  49. # end of Tk::Frame::labelPack
  50. 1;
  51.