1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w
use strict;
use Tk;
my $window= MainWindow->new;
my $c1 = $window->Canvas(-background => 'saddlebrown', -width => '350', -height => '150')->pack;
$c1->createText(175, 10, -fill => 'orange', -text => 'Print Queue Monitor');
$c1->createLine(0, 20, 351, 20, -fill => 'orange');
my $jobs01=`ls -all /directory/ | wc -l | awk \'{print \$1}\'`;
chomp ($jobs01);
$jobs01 +=88;
$c1->createLine(88, 65, $jobs01, 65, -width => '10', -fill => 'green');
$c1->createText(45, 65, -fill => 'orange', -text => 'Spooler 1');
MainLoop;
my $anzahl_dateien = () = readdir $dh;
2012-08-07T11:03:51 MolafHallo,
Code (perl): (dl )my $anzahl_dateien = () = readdir $dh;
hier sollte $anzahl_dateien aber um 2 zu hoch sein, readdir liefert ja auch noch '.' und '..' mit.
2012-08-07T08:47:12 Raubtierperldoc Tk::after
$widget->repeat(ms,callback)
1 2 3 4 5 6 7 8 9 10
$window->repeat(5000, \&showcount); ....... sub showcount { $balk and $c1->delete($balk); my $jobs01 = ...; chomp ($jobs01); $balk = $c1->createLine(88, 65, $jobs01+88, 65, -width => '10', -fill => 'green'); return; }