ChildNotification.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 45 CC 3 SCAR 12.4
CC
3
Cov
0%
Tk::Derived::InitObject
6.0
Tk::Widget::InitObject
6.0
BEGIN
2.0
CRAP 3.5
1 package Tk::ChildNotification;
2  
3 BEGIN
4 {
5 $Tk::ChildNotification::DerivedInitObject = \&Tk::Derived::InitObject;
6 $Tk::ChildNotification::WidgetInitObject = \&Tk::Widget::InitObject;
7 }
8  
9 use vars qw ($VERSION);
10 use strict;
11 use Tk;
12  
13 use Tk::Derived;
14 use Tk::Widget;
15  
16 $VERSION = '0.01';
17  
18 sub Tk::Derived::InitObject
19 {
20 my $l_Return = &{$Tk::ChildNotification::DerivedInitObject} (@_);
21 $_[0]->parent()->ChildNotification (@_) if (defined ($_[0]->parent()));
22 return $l_Return;
23 }
24  
25 sub Tk::Widget::InitObject
26 {
27 my $l_Return = &{$Tk::ChildNotification::WidgetInitObject} (@_);
28 $_[0]->parent()->ChildNotification (@_) if (defined ($_[0]->parent()));
29 return $l_Return;
30 }
31  
32 #
33 # Override this method when you want to know when a child has been
34 # created for you. Don't globally override it (leave out the 'Tk::Widget::'
35 # part).
36 #
37 sub Tk::Widget::ChildNotification
38 {
39 my ($this, $p_Child) = (shift, @_);
40 }
41  
42 1;
43  
44 __END__