Debian Codegraph @

Tk/ROText.pm

raw
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 $VERSION = '4.011';
9
10 use Tk::Text;
11 use base qw(Tk::Derived Tk::Text);
12
13 Construct Tk::Widget 'ROText';
14
15 sub clipEvents
16 {
17 return qw[Copy];
18 }
19
20 sub ClassInit
21 {
22 my ($class,$mw) = @_;
23 my $val = $class->bindRdOnly($mw);
24 my $cb = $mw->bind($class,'<Next>');
25 $mw->bind($class,'<space>',$cb) if (defined $cb);
26 $cb = $mw->bind($class,'<Prior>');
27 $mw->bind($class,'<BackSpace>',$cb) if (defined $cb);
28 $class->clipboardOperations($mw,'Copy');
29 return $val;
30 }
31
32 sub Populate
33 {
34 my($self,$args) = @_;
35 $self->SUPER::Populate($args);
36 my $m = $self->menu->entrycget($self->menu->index('Search'), '-menu');
37 $m->delete($m->index('Replace'));
38 $self->ConfigSpecs(-background => ['SELF'],
39 -foreground => ['SELF'],
40 );
41 }
42
43 sub Tk::Widget::ScrlROText { shift->Scrolled('ROText' => @_) }
44
45 1;
46
47 __END__
48