Thread Tk::ProgressBar (27 answers)
Opened by renee at 2005-09-28 15:40

ptk
 2005-10-10 19:38
#44668 #44668
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
[quote=Strat,28.09.2005, 15:11]Problem mit dem sleep? Gab's da nicht mal ein Tk::sleep? [/quote]
Leider nicht, aber du kannst folgendes verwenden:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=head2 tk_sleep

=for category Tk

$top->tk_sleep($s);

Sleep $s seconds (fractions are allowed). Use this method in Tk
programs rather than the blocking sleep function. The difference to
$top->after($s/1000) is that update events are still allowed in the
sleeping time.

=cut

sub Tk::Widget::tk_sleep {
my($top, $s) = @_;
my $sleep_dummy = 0;
$top->after($s*1000,
sub { $sleep_dummy++ });
$top->waitVariable(\$sleep_dummy)
unless $sleep_dummy;
}

View full thread Tk::ProgressBar