line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Sudoku::Component::TkPlayer::Splashscreen;
|
2
|
|
|
|
|
|
|
{
|
3
|
1
|
|
|
1
|
|
1584
|
use strict;
|
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
71
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
622
|
use Tk::widgets qw/Toplevel/;
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use base qw/Tk::Toplevel/;
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Construct Tk::Widget 'Splashscreen';
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Tk::ProgressBar;
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub Populate {
|
15
|
|
|
|
|
|
|
my $this = shift;
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$this->withdraw;
|
18
|
|
|
|
|
|
|
$this->geometry('300x50+0+0');
|
19
|
|
|
|
|
|
|
$this->overrideredirect(1);
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$this->SUPER::Populate(@_);
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$this->Label(
|
24
|
|
|
|
|
|
|
-text => 'Loading...',
|
25
|
|
|
|
|
|
|
)->pack(
|
26
|
|
|
|
|
|
|
-fill => 'x',
|
27
|
|
|
|
|
|
|
-expand => 1,
|
28
|
|
|
|
|
|
|
);
|
29
|
|
|
|
|
|
|
$this->{pbar} = $this->ProgressBar(
|
30
|
|
|
|
|
|
|
-anchor => 'w',
|
31
|
|
|
|
|
|
|
-colors => [0, 'blue'],
|
32
|
|
|
|
|
|
|
)->pack(
|
33
|
|
|
|
|
|
|
-side => 'top',
|
34
|
|
|
|
|
|
|
-fill => 'x',
|
35
|
|
|
|
|
|
|
-padx => 10,
|
36
|
|
|
|
|
|
|
-pady => 10,
|
37
|
|
|
|
|
|
|
);
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub progress {
|
41
|
|
|
|
|
|
|
my ($this, $value) = @_;
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$this->{pbar}->value($value);
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub Show {
|
47
|
|
|
|
|
|
|
my ($this, %args) = @_;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$this->{pbar}->configure(
|
50
|
|
|
|
|
|
|
-blocks => int($args{-max} / 5),
|
51
|
|
|
|
|
|
|
-to => $args{-max},
|
52
|
|
|
|
|
|
|
);
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$this->{old_focus} = $this->focusSave;
|
55
|
|
|
|
|
|
|
$this->{old_grab} = $this->grabSave;
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
$this->transient($this->Parent->toplevel);
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$this->Popup(
|
60
|
|
|
|
|
|
|
-popover => $this->Parent,
|
61
|
|
|
|
|
|
|
-overanchor => 'c',
|
62
|
|
|
|
|
|
|
-popanchor => 'se',
|
63
|
|
|
|
|
|
|
);
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$this->grab;
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
if (my $focusw = $this->cget(-focus)) {
|
68
|
|
|
|
|
|
|
$focusw->focus;
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
else {
|
71
|
|
|
|
|
|
|
$this->focus;
|
72
|
|
|
|
|
|
|
}
|
73
|
|
|
|
|
|
|
}
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub Hide {
|
76
|
|
|
|
|
|
|
my $this = shift;
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$this->grabRelease;
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$this->{old_focus}->();
|
81
|
|
|
|
|
|
|
$this->{old_grab}->();
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
$this->withdraw;
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
}
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1;
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__
|