2 Einträge, 1 Seite |
Thread failed to start: Can't call method "createLine" on an undefined value at C:\neu3.pl line 302, <DATA> line 164.
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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;
}
}
}
2 Einträge, 1 Seite |