Schrift
[thread]5303[/thread]

Programm läuft nicht im KDE-Menü



<< >> 2 Einträge, 1 Seite
Gast Gast
 2007-03-09 17:29
#46258 #46258
Hallo,

ich habe mir ein kleines Programm zusammengestrickt das ich bis jetzt von der Konsole gestartet habe. Nun habe ich es in das KDE-Menü eingetragen und will es von dort starten.
Jedoch läuft das Programm nicht bzw. sehr zäh. Speziell bei den "system" aufrufen.
Anbei mal den Code
Code: (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
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
70
71
72
73
74
#!/usr/bin/perl -w

use Tk;
use strict;
use warnings;


my $status = "offline";
my $eingewaehlt=0;


my $mw = MainWindow->new(-bg => 'blue');
$mw->resizable(0,0);
# $mw->overrideredirect(0);

#my $frameStatus = $mw->Frame(-relief => 'ridge', -border => 2)->pack(-side => 'bottom', -fill => 'x');
#$frameStatus->Label(-text => 'Status: ')->pack(-side => 'left');
#$frameStatus->Label(-textvariable => \$Status)->pack(-side => 'left');

$mw->Label(-text => 'I S D N  -  A n w a h l', -bg => 'yellow')->pack(-side => 'top');
$mw-> Button (-text => 'Internet'    , -width => '15', -bg => 'orange', -command => [\&anwahl,'internet'])-> pack(-side => 'top');
$mw-> Button (-text => 'Grimma'      , -width => '15', -bg => 'orange', -command => [\&anwahl,'grimma'])-> pack(-side => 'top');
$mw-> Button (-text => 'Koermend'    , -width => '15', -bg => 'orange', -command => [\&anwahl,'koermend'])-> pack(-side => 'top');
$mw-> Button (-text => 'Csoeroetnek' , -width => '15', -bg => 'orange', -command => [\&anwahl,'csoeroetnek'])-> pack(-side => 'top');
$mw-> Button (-text => 'Bernburg'    , -width => '15', -bg => 'orange', -command => [\&anwahl,'bernburg'])-> pack(-side => 'top');

# $mw->Label(-text => '==================', -bg => 'blue')-> pack();
$mw-> Button (-text => 'auflegen'    , -width => '15', -bg => 'red', -command => sub{system "poff";$eingewaehlt=0;})-> pack(-side => 'top');
# $mw->Label(-text => '==================', -bg => 'blue')-> pack();
$mw->Label(-textvariable => \$status, -fg=> 'yellow', -bg=> 'blue')->pack(-side => 'top');

my $idafter=$mw->after (750,[\&checkanwahl]);

MainLoop;

#############################################################################################################################################
sub anwahl {

my $ziel = shift;
my $repl;

system "poff";
sleep 1;
$repl = system "pon isdn/$ziel";
$eingewaehlt = 1;

if ($ziel eq 'bernburg')
{
system 'vncviewer';
}

}
#############################################################################################################################################
sub checkanwahl {

if ($eingewaehlt != 1 )
{
$status = 'O F F L I N E';
}
else
{
if ($status eq 'O N L I N E')
{
$status = '';
}
else
{
$status = 'O N L I N E';
}
}

$idafter=$mw->after (750,[\&checkanwahl]);
}
#############################################################################################################################################


Hat jemand eine Idee ?

         Danke
             worst_case
ptk
 2007-03-10 00:18
#46259 #46259
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Debugging-Tipp: lenk mal STDOUT und STDERR in eine Datei und schau nach, ob da etwas steht.
<< >> 2 Einträge, 1 Seite



View all threads created 2007-03-09 17:29.