use strict; use Tk; use Tk::Canvas; my $mw = MainWindow->new(); # erstelle das canvas und einen pfeil mit der länge $length my $length = 300; my $canvas = $mw->Canvas(-bg => 'white')->pack(); $canvas->createLine( 0,200,$length,200, -arrowshape => [6,10,3], -width => 2, -arrow => 'last' ); fill($canvas); Tk::MainLoop(); sub fill{ my $widget = shift; my @dates = ([4,"Frisör"],[7,"Arzt"],[20,"Restaurant"]); my $unit = $length / 30; # teile die länge des zeitstrahles durch die anzahl der tage foreach my $date (@dates){ $widget->createText($unit*$date->[0],180, -text => $date->[1]); $widget->createText($unit*$date->[0],210, -text => $date->[0]); $widget->createLine($unit*$date->[0],190,$unit*$date->[0],200); } }