home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _b0bbbb85aace99d1ea29926957e6ff31 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.0 KB  |  44 lines

  1. # Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
  2. # This program is free software; you can redistribute it and/or
  3. # modify it under the same terms as Perl itself.
  4. package Tk::ROText;
  5.  
  6. use vars qw($VERSION);
  7. $VERSION = sprintf '4.%03d', q$Revision: #10 $ =~ /\D(\d+)\s*$/;
  8.  
  9. use Tk::Text;
  10. use base  qw(Tk::Derived Tk::Text);
  11.  
  12. Construct Tk::Widget 'ROText';
  13.  
  14. sub clipEvents
  15. {
  16.  return qw[Copy];
  17. }
  18.  
  19. sub ClassInit
  20. {
  21.  my ($class,$mw) = @_;
  22.  my $val = $class->bindRdOnly($mw);
  23.  my $cb  = $mw->bind($class,'<Next>');
  24.  $mw->bind($class,'<space>',$cb) if (defined $cb);
  25.  $cb  = $mw->bind($class,'<Prior>');
  26.  $mw->bind($class,'<BackSpace>',$cb) if (defined $cb);
  27.  $class->clipboardOperations($mw,'Copy');
  28.  return $val;
  29. }
  30.  
  31. sub Populate {
  32.     my($self,$args) = @_;
  33.     $self->SUPER::Populate($args);
  34.     my $m = $self->menu->entrycget($self->menu->index('Search'), '-menu');
  35.     $m->delete($m->index('Replace'));
  36. }
  37.  
  38. sub Tk::Widget::ScrlROText { shift->Scrolled('ROText' => @_) }
  39.  
  40. 1;
  41.  
  42. __END__
  43.  
  44.