my $mw; my $ControlFrame; my $ControlGraphFrame; my $Canvas; . . . #Aufruf in MainThread: $ControlFrame = $mw->Frame( -borderwidth=>'2', -label=>"Kontrollelemente")->pack(-side=>'bottom', -expand=>'1', &n bsp; &n bsp; -fill=>'both'); $ControlGraphFrame = $ControlFrame->Frame( -borderwidth=>'2', &n bsp; &n bsp; -background=>'white',-label=>"Graph")->pack( -side=>'top',-expand=>'1',-fill=>'both'); $Canvas=$ControlGraphFrame->Scrolled('Canvas',-background=>'white',-height=>$graphYSize+20,-width=>$graphXSize)->pack(-fill=>'both'); . . . #und hier der unterthread: sub GraphThread{ require Tk; Tk->import; while (1) { if ($var==1) { print "thread doing work\n"; { sleep(1); $newValue = &Measure;   ; $newDraw=$graphYSize/(1<<$resolution) * $newValue; $oldDraw = $graphYSize/(1<<$resolution) * $oldValue; printf "%u - %u\n", $oldValue, $newValue; $scaleLine = $Canvas->createLine(10,10,$graphXSize,10); $count += $xShift; $oldValue = $newValue; } } elsif($var == 0) { print "thread waiting\n"; sleep(1); } else { print "thread finished\n"; return; } } }