lib/App/SeismicUnixGui/misc/label_boxes.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 47 CC 1 SCAR 6.9
CC
1
Cov
0%
texts
2.0
get_aref
2.0
get_w_aref
2.0
CRAP 2.0
1 package App::SeismicUnixGui::misc::label_boxes;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5 use Tk;
6 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
7  
8 my $get = L_SU_global_constants->new();
9 my $var = $get->var();
10  
11 =head1 DOCUMENTATION
12  
13 =head2 SYNOPSIS
14  
15 PERL PROGRAM NAME: label_boxes.pm
16 AUTHOR: Juan Lorenzo
17 DATE: June 23 2017
18  
19 DESCRIPTION:
20 Create
21 many empty labels
22
23 USED FOR:
24  
25 BASED ON:
26  
27 NEEDS:
28  
29 =cut
30  
31 =head2 private hash references
32  
33 =cut
34  
35 my $label_boxes = {
36  
37 _first => '',
38 _length => '',
39 _frame => '',
40 _labels_w_aref => '',
41  
42 };
43  
44 =head2 sub texts
45
46 populate Label widget box with new text
47  
48 =cut
49  
50 sub texts {
51 my ( $self, $label_array_ref ) = @_;
52  
53 my (@labels_w);
54 my ( $first, $last, $frame_ref );
55  
56 $first = $label_boxes->{_first_entry_idx};
57 $last = $label_boxes->{_length};
58 $frame_ref = $label_boxes->{_frame};
59  
60 for ( my $i = $first ; $i < $last ; $i++ ) {
61 $labels_w[$i] = $$frame_ref->Label(
62 -height => $var->{_one_character},
63 -width => $var->{_thirty_five_characters},
64 -text => @$label_array_ref[$i],
65 -borderwidth => $var->{_one_pixel_borderwidth},
66 -background => $var->{_light_gray},
67 );
68 }
69 $label_boxes->{_labels_w_aref} = \@labels_w;
70 }
71  
72 =head2 get_aref
73 in future
74 use the get_w_aref version instead
75 =cut
76  
77 sub get_aref {
78  
79 my ($self) = @_;
80  
81 return ( $label_boxes->{_labels_w_aref} );
82  
83 }
84  
85 =head2 get_w_aref
86  
87 =cut
88  
89 sub get_w_aref {
90  
91 my ($self) = @_;
92  
93 return ( $label_boxes->{_labels_w_aref} );
94  
95 }
96  
97 =head2 sub specs
98
99 dimensions of the array
100  
101 =cut
102  
103 sub specs {
104  
105 my ( $self, $specs_hash_ref ) = @_;
106  
107 $label_boxes->{_first_entry_idx} = $specs_hash_ref->{_first_entry_idx};
108 $label_boxes->{_length} = $specs_hash_ref->{_length};
109  
110 }
111  
112 =head2 sub frame
113  
114 reference of holding widget frame for labels
115  
116 =cut
117  
118 sub frame {
119 my ( $self, $frame_ref ) = @_;
120 $label_boxes->{_frame} = $frame_ref;
121  
122 }
123  
124 1;