blib/lib/Gtk2/Ex/FormFactory/Button.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 49 CC 1 SCAR 6.9
CC
1
Cov
0%
get_type
2.0
has_label
2.0
get_clicked_hook
2.0
CRAP 2.0
1 package Gtk2::Ex::FormFactory::Button;
2  
3 use strict;
4  
5 use base qw( Gtk2::Ex::FormFactory::Widget );
6  
7 sub get_type { "button" }
8 sub has_label { 1 }
9  
10 sub get_clicked_hook { shift->{clicked_hook} }
11 sub get_stock { shift->{stock} }
12 sub get_with_repeat { shift->{with_repeat} }
13 sub get_image { shift->{image} }
14  
15 sub set_clicked_hook { shift->{clicked_hook} = $_[1] }
16 sub set_stock { shift->{stock} = $_[1] }
17 sub set_with_repeat { shift->{with_repeat} = $_[1] }
18 sub set_image { shift->{image} = $_[1] }
19  
20 sub new {
21 my $class = shift;
22 my %par = @_;
23 my ($stock, $clicked_hook, $with_repeat, $image) =
24 @par{'stock','clicked_hook','with_repeat','image'};
25  
26 my $self = $class->SUPER::new(@_);
27  
28 $self->set_stock($stock);
29 $self->set_image($image);
30 $self->set_clicked_hook($clicked_hook);
31 $self->set_with_repeat($with_repeat);
32
33 return $self;
34 }
35  
36 1;
37  
38 __END__