#!/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]); } #############################################################################################################################################