diff options
author | mertz | 2002-03-12 17:02:49 +0000 |
---|---|---|
committer | mertz | 2002-03-12 17:02:49 +0000 |
commit | 9f9717711fed84aec81f6530266b7e97ad831ecc (patch) | |
tree | 77f81a44b9e6bead9d95f8d8836d1d1cf5fe2080 /Perl/demos/Tk/demos/zinc_lib/lines.pl | |
parent | 9b8d0d371f494ce0059db9e0cc7d63cbcefae91d (diff) | |
download | tkzinc-9f9717711fed84aec81f6530266b7e97ad831ecc.zip tkzinc-9f9717711fed84aec81f6530266b7e97ad831ecc.tar.gz tkzinc-9f9717711fed84aec81f6530266b7e97ad831ecc.tar.bz2 tkzinc-9f9717711fed84aec81f6530266b7e97ad831ecc.tar.xz |
demos d�plac�es de examples/ vers demos/
ajout de nouvelles demos: tkZincLogo.pl window-contours.pl
Diffstat (limited to 'Perl/demos/Tk/demos/zinc_lib/lines.pl')
-rw-r--r-- | Perl/demos/Tk/demos/zinc_lib/lines.pl | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/lines.pl b/Perl/demos/Tk/demos/zinc_lib/lines.pl new file mode 100644 index 0000000..26d52c6 --- /dev/null +++ b/Perl/demos/Tk/demos/zinc_lib/lines.pl @@ -0,0 +1,93 @@ +#!/usr/bin/perl +# $Id$ +# these simple samples have been developped by C. Mertz mertz@cena.fr + +use Tk; +use Tk::Zinc; +use strict; + +my $defaultfont = '-adobe-helvetica-bold-r-normal-*-120-*-*-*-*-*-*'; +my $mw = MainWindow->new(); +my $zinc = $mw->Zinc(-width => 700, -height => 600, + -font => "10x20", # usually fonts are sets in resources + # but for this example it is set in the code! + -borderwidth => 3, -relief => 'sunken', + )->pack; + +$zinc->add('text', 1, + -font => $defaultfont, + -text => "A set of lines with different styles of lines and termination\n". + "NB: some attributes such as line styles are not necessarily\n". + " available with an openGL rendering system" , + -anchor => 'nw', + -position => [20, 20]); + +$zinc-> add('curve', 1, [20, 100, 320, 100]); # default options +$zinc-> add('curve', 1, [20, 120, 320, 120], + -linewidth => 20, + ); +$zinc-> add('curve', 1, [20, 160, 320, 160], + -linewidth => 20, + -capstyle => "butt", + ); +$zinc-> add('curve', 1, [20, 200, 320, 200], + -linewidth => 20, + -capstyle => "projecting", + ); +$zinc-> add('curve', 1, [20, 240, 320, 240], + -linewidth => 20, + -linepattern => "AlphaStipple7", + -linecolor => "red", + ); + +# right column +$zinc-> add('curve', 1, [340, 100, 680, 100], + -firstend => [10, 10, 10], + -lastend => [10, 25, 45], + ); +$zinc-> add('curve', 1, [340, 140, 680, 140], + -linewidth => 2, + -linestyle => 'dashed', + ); +$zinc-> add('curve', 1, [340, 180, 680, 180], + -linewidth => 4, + -linestyle => 'mixed', + ); +$zinc-> add('curve', 1, [340, 220, 680, 220], + -linewidth => 2, + -linestyle => 'dotted', + ); + +$zinc->add('curve', 1, [20, 300, 140, 360, 320, 300, 180, 260], + -closed => 1, + -filled => 1, + -fillpattern => "Tk", + -fillcolor => "grey60", + -linecolor => "red", + -marker => "AtcSymbol7", + -markercolor => "blue", + + ); + + +$zinc->add('curve', 1, [340, 300, 440, 360, 620, 300, 480, 260], + -closed => 1, + -linewidth => 10, + -joinstyle => "miter", #"round", # "bevel" | "miter" + -linecolor => "red", + ); +$zinc->add('curve', 1, [400, 300, 440, 330, 560, 300, 480, 280], + -closed => 1, + -linewidth => 10, + -joinstyle => "round", # "bevel" | "miter" + -tile => Tk::findINC("Xcamel.gif"), + -fillcolor => "grey60", + -filled => 1, + -linecolor => "red", + ); + +# -tile => Tk::findINC("Xcamel.gif"), + +MainLoop; + + |