| Thread Warten auf Toplevel-Fenster unterhalb einer Subroutine mit MainLoop funktioniert nicht
(2 answers) Opened by skontox at 2008-08-31 16:49 
meinst du so etwas? Code (perl): (dl
) 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 27 28 #! /usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); createWindowandWait(); print "fertig!\n"; Tk::MainLoop(); sub createWindowandWait{ my $window = $mw->Toplevel(); my $ok = undef; $window->Button( -text => 'fertig!', -command => sub{$ok = 1;} )->pack(); $window->focusForce(); # warte solange bis variable '$ok' den wert true hat: $window->waitVariable(\$ok); } Gerade weil wir alle in einem Boot sitzen, sollten wir froh sein, dass nicht alle auf unserer Seite sind |