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
=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;
}
Kean+2008-05-08 17:34:12--Ich habe ein ähnliches Problem. Ich nutze das Modul Imager um ein Bild zu verändern und das dauert unter umständen ziemlich lange.
Wie kann ich am einfachsten eine Sanduhr einsetzen?
1 2 3
$window->configure(-cursor => $neuer_cursor); $window->idletaks; # braucht man, damit der Cursor # sofort geändert wird
$mw->idletaks;
1
2
3
4
5
6
7
8
9
10
11
12
13
Tk::Error: Failed to AUTOLOAD 'MainWindow::idletaks' at c:\Dokumente und Einstel
lungen\User\Desktop\test3.pl line 154
Carp::croak at C:/Perl/lib/Carp.pm line 44
Tk::Widget::__ANON__ at C:/Perl/lib/Tk/Widget.pm line 347
main::NewPicture at c:\Dokumente und Einstellungen\User\Desktop\test3.pl li
ne 154
main::SelectFile at c:\Dokumente und Einstellungen\User\Desktop\test3.pl li
ne 140
Tk callback for .button
Tk::__ANON__ at C:/Perl/lib/Tk.pm line 252
Tk::Button::butUp at C:/Perl/lib/Tk/Button.pm line 111
<ButtonRelease-1>
(command bound to event)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
sub NewPicture { $mw->configure(-cursor => "watch"); $mw->idletasks; zoom(); rotate(); $canvas->delete("picture"); $image_in = $canvas->Photo( -file => $file_use, -format => $image_format ); if ($image_in->height() < 200 || $image_in->width() < 166) { $statuslbl->configure(-text=>"Das ausgewählte Foto ist zu klein!!"); return; } $picture = $canvas->createImage(0,0,-image => $image_in, -anchor => "nw", -tags => "picture"); $canvas->raise("rectangle", "all"); $mw->configure(-cursor => "arrow"); }
![]() |
|< 1 2 3 >| | ![]() |
28 Einträge, 3 Seiten |