#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Zinc; my $mw = MainWindow->new; my $width = 700; my $height = 600; $mw->geometry($width.'x'.$height); my $zinc = $mw->Zinc(-width => $width, -height => $height, -backcolor => 'black', -borderwidth => 3, -relief => 'sunken', )->pack; $zinc->fontCreate( "fonta", -family => 'arial', -size => 30, -weight => 'normal' ); #create a group with it's origin at center my $centergroup= $zinc->add('group',1,-visible=> 1); $zinc->scale($centergroup,1,-1); #reverse direction of y axis $zinc->translate($centergroup,$width/2,$height/2); # Then we create a gray filled rectangle, in which we will display explain text. $zinc->add('rectangle', $centergroup , [-100, -100, 100, 100], -linewidth => 2, -filled => 1, -fillcolor => 'SkyBlue', ); my $text = $zinc->add('text', $centergroup, -position => [0,0], -text => 'foobaz', -font => 'fonta', -anchor => 'center', -priority => 2 ); MainLoop;