aboutsummaryrefslogtreecommitdiff
path: root/sandbox
diff options
context:
space:
mode:
authorlecoanet2002-03-15 13:24:44 +0000
committerlecoanet2002-03-15 13:24:44 +0000
commit9621aa3d2ad54201c486d9ef5821d54862463f38 (patch)
tree8a00e77cdf39f8e38ec841168136603a08e42a50 /sandbox
parent9a53d4578e60d558ac5b4208be7c3dace011c736 (diff)
downloadtkzinc-9621aa3d2ad54201c486d9ef5821d54862463f38.zip
tkzinc-9621aa3d2ad54201c486d9ef5821d54862463f38.tar.gz
tkzinc-9621aa3d2ad54201c486d9ef5821d54862463f38.tar.bz2
tkzinc-9621aa3d2ad54201c486d9ef5821d54862463f38.tar.xz
*** empty log message ***
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/testrelief.pl72
1 files changed, 72 insertions, 0 deletions
diff --git a/sandbox/testrelief.pl b/sandbox/testrelief.pl
new file mode 100644
index 0000000..15dc0b2
--- /dev/null
+++ b/sandbox/testrelief.pl
@@ -0,0 +1,72 @@
+#!/usr/bin/perl -w
+
+use Tk;
+use Tk::Zinc;
+use Controls;
+
+$top = 1;
+$lw = 8;
+
+$mw = MainWindow->new();
+$zinc = $mw->Zinc(-backcolor => 'gray',
+ -relief => 'sunken',
+ -lightangle => 120,
+ -render => 1);
+$zinc->pack(-expand => 1,
+ -fill => 'both');
+$zinc->configure(-width => 1024,
+ -height => 800);
+$zinc->scale($top, 1, -1);
+
+$view = $zinc->add('group', $top, -tags => 'controls');
+
+sub polypoints {
+ ($ox, $oy, $rad, $n, $startangle) = @_;
+
+ $step = 2 * 3.14159 / $n;
+ $startangle = $startangle*3.14159/180;
+ $coords = [];
+ for ($i = 0; $i < $n; $i++) {
+ $x = $ox + ($rad * cos($i * $step + $startangle));
+ $y = $oy + ($rad * sin($i * $step + $startangle));
+ push(@{$coords}, $x, $y);
+ }
+ push(@{$coords}, $coords->[0], $coords->[1]);
+ return $coords
+}
+
+$zinc->add('curve', $view, polypoints(200, -200, 100, 40, 0),
+ -relief => 'raised',
+ -linewidth => $lw,
+ -smoothrelief => 1,
+ -fillcolor => 'lightblue',
+ -linecolor => 'lightblue',
+ -filled => 1);
+
+$zinc->add('curve', $view, polypoints(450, -200, 100, 40, 0),
+ -relief => 'raised',
+ -linewidth => $lw,
+ -smoothrelief => 1,
+ -fillcolor => 'tan',
+ -linecolor => 'tan',
+ -filled => 1);
+
+$zinc->add('curve', $view, polypoints(700, -200, 100, 40, 0),
+ -relief => 'sunken',
+ -linewidth => $lw,
+ -smoothrelief => 1,
+ -fillcolor => 'tan',
+ -linecolor => 'tan',
+ -filled => 1);
+
+$zinc->add('curve', $view, polypoints(200, -450, 100, 4, -45),
+ -relief => 'sunken',
+ -linewidth => $lw,
+ -fillcolor => 'tan',
+ -linecolor => 'tan',
+ -filled => 1);
+
+
+new Controls($zinc);
+MainLoop();
+