#!/usr/bin/perl
use warnings;
use strict;
use Tk::Zinc;
my $width = 100;
my $height = 100;
my $mw = MainWindow->new(-background => 'cyan');
$mw->geometry($width.'x'.$height.'+300+300');
$mw->overrideredirect(1);
my $zinc = $mw->Zinc(-width => $width,
-height => $height,
-reshape => 1, #clips zinc
-fullreshape => 1, #clips $mw and xterm
-backcolor => 'cyan',
)->pack;
#make a flower
my $petal = $zinc->add('curve',1,[[$width/2,$height], [0,0, 'c'],
[$width,0, 'c'], [$width/2,$height]],
-tags => ['bezier1'],
-filled => 1,
-fillcolor => 'cyan',
-closed => 1,
-linewidth => 0,
-priority => 1,
-visible => 0,
);
# using the triangulaire curve to reshape both TkZinc and Mainwindow w
+idgets
$zinc->itemconfigure(1, -clip => $petal);
my $petal1 = $zinc->add('curve',1,[[$width/2,$height], [-2*$width,-100
+, 'c'],
[3*$width,-100, 'c'], [$width/2,$hei
+ght]],
-tags => ['bezier1'],
-filled => 1,
-fillcolor => 'cyan',
-closed => 1,
-linewidth => 0,
-priority => 1,
-visible => 1,
);
&Tk::MainLoop;
| [reply] [Watch: Dir/Any] [d/l] |
Boy! That was quick!
Unfortunately I'm having problems locating Tk::Zinc. It's not showing on PPM under ActivePerl, and CPAN Tk::Zinc doesn;t appear to find it either. The CPAN website lists http://www.tkzinc.org/ or http://freshmeat.net/projects/zincisnotcanvas/ as possible sources, but the first looks duff to me, and downloading from the second reports 'file not found'.
Anyone know where I can find Tk::Zinc, please?
| [reply] [Watch: Dir/Any] |
I don't have ActivePerl or Tk modules installed on my system, but using the CPAN shell, I was able to download Tk::Zinc without any issues. Are you sure that you have cpan configured properly for you network (such as web/ftp proxies)?
Also, if you use your web browser to go to Tk::Zinc, you can download the tarball to manually install it. Look for the link for tk-zinc-3.303.tar.gz in the upper right hand portion of the screen. Keep in mind that if you plan to download and manually install this module, you'll have to manually take care of any needed dependencies too.
| [reply] [Watch: Dir/Any] |
Metacpan found it no problem. Tk::Zinc The ppms for Windows can be found at bribes.org ppms The ppms are listed for various recent Perl releases.
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |