Leser: 3
|< 1 2 3 >| | 28 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::ProgressBar;
my $mw = tkinit;
my $btn = $mw->Button(-text => 'start...', -command => \&readdr)->pack();
MainLoop;
sub readdr{
my $top = $mw->Toplevel();
my $progress = $top->ProgressBar(-from => 0,
-to => 100,
-colors => [0,'green'],
-gap => 1)->pack();
opendir(DIR,'.') or die $!;
while(my $file = readdir(DIR)){
my $values = $progress->value();
$progress->value($values+2);
sleep(1);
}
closedir(DIR);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::ProgressBar;
my $mw = tkinit;
my $btn = $mw->Button(-text => 'start...', -command => \&readdr)->pack();
MainLoop;
sub readdr{
my $top = $mw->Toplevel();
# $mw->update();
my $progress = $top->ProgressBar(-from => 0, -to => 100, -colors => [0,'green'],
-gap => 1)->pack();
$progress->update();
my $id = $progress->repeat(2,sub{
my $values = $progress->value();
$progress->value($values+2);
$progress->update();
});
sleep(10);
$id->cancel();
}
|< 1 2 3 >| | 28 Einträge, 3 Seiten |