line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TidyView::Frame; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# the whole idea here is to try to centralise the creation of Tk::Frame widgets to one point of the code. |
4
|
|
|
|
|
|
|
# However, it turns out we usually over-ride at least one of the defaults every time we create a frame, |
5
|
|
|
|
|
|
|
# so perhaps it was a bad idea. |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
46666
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
96
|
|
8
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
78
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
1392
|
use Tk; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $frameDefaults = { |
13
|
|
|
|
|
|
|
-relief => 'ridge', |
14
|
|
|
|
|
|
|
-borderwidth => 5, |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $packDefaults = { |
18
|
|
|
|
|
|
|
-side => 'left', |
19
|
|
|
|
|
|
|
-fill => 'both', |
20
|
|
|
|
|
|
|
-expand => 1, |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new { |
24
|
|
|
|
|
|
|
my (undef, %args) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my ($parent, $frameOptions, $packOptions) = @args{qw(parent frameOptions packOptions)}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$frameOptions ||= {}; |
29
|
|
|
|
|
|
|
$packOptions ||= {}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my %frameOptions = (%$frameDefaults, %$frameOptions); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my %packOptions = (%$packDefaults, %$packOptions); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $frame = $parent->Frame(%frameOptions); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$frame->pack(%packOptions); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $frame; |
40
|
|
|
|
|
|
|
} |