home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _18b7f68b80b27ff86cec06f11799929f < prev    next >
Text File  |  2004-06-01  |  752b  |  41 lines

  1. package Tk::Compound;
  2. require Tk;
  3. import  Tk qw($XS_VERSION);
  4. require Tk::Image;
  5.  
  6. use vars qw($VERSION);
  7. $VERSION = '4.004'; # $Id: //depot/Tkutf8/Compound/Compound.pm#4 $
  8.  
  9. use base  qw(Tk::Image);
  10.  
  11. Construct Tk::Image 'Compound';
  12.  
  13. bootstrap Tk::Compound;
  14.  
  15. sub Tk_image { 'compound' }
  16.  
  17. Tk::Methods('add');
  18.  
  19. sub new
  20. {
  21.  my $package = shift;
  22.  my $widget  = shift;
  23.  my $leaf = $package->Tk_image;
  24.  $package->InitClass($widget);
  25.  my $obj = $widget->image(create => $leaf,@_,-window => $widget);
  26.  return bless($obj,$package);
  27. }
  28.  
  29. BEGIN
  30.  {
  31.   foreach my $type (qw(line text image bitmap space))
  32.    {
  33.     my $meth = ucfirst($type);
  34.     no strict qw 'refs';
  35.     *{$meth} = sub { shift->add($type,@_) };
  36.    }
  37.  }
  38.  
  39. 1;
  40. __END__
  41.