aboutsummaryrefslogtreecommitdiff
path: root/demos/fillRule.tcl
diff options
context:
space:
mode:
authorlecoanet2004-02-23 09:16:48 +0000
committerlecoanet2004-02-23 09:16:48 +0000
commitef07ddc87875cc9b88715099434e2dcff4726322 (patch)
treeacd7f4fb3fbec0b056dcac6cf340803f67cc9244 /demos/fillRule.tcl
parent8b11edd43da0482b2d427c8789a03aacb0f5b3fa (diff)
downloadtkzinc-ef07ddc87875cc9b88715099434e2dcff4726322.zip
tkzinc-ef07ddc87875cc9b88715099434e2dcff4726322.tar.gz
tkzinc-ef07ddc87875cc9b88715099434e2dcff4726322.tar.bz2
tkzinc-ef07ddc87875cc9b88715099434e2dcff4726322.tar.xz
Started reworking Tcl demos
Diffstat (limited to 'demos/fillRule.tcl')
-rw-r--r--demos/fillRule.tcl28
1 files changed, 17 insertions, 11 deletions
diff --git a/demos/fillRule.tcl b/demos/fillRule.tcl
index d04b211..640fd1e 100644
--- a/demos/fillRule.tcl
+++ b/demos/fillRule.tcl
@@ -28,12 +28,15 @@ pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
####### -fillrule attribute of curves
####### contour coords and clone method
-zinc $w.zinc -width 550 -height 630 -font 10x20 -borderwidth 0 -backcolor white
+set imagePath [file join $zinc_library demos images]
+set texture [image create photo -file [file join $imagePath paper-grey1.gif]]
+
+zinc $w.zinc -width 550 -height 680 -font 10x20 -borderwidth 0 -tile $texture
pack $w.zinc
-$w.zinc add text 1 -position {20 8} -text {This still static example reproduces figure 11-3
- of "The OpenGL Programming Guide 3rd Edition" V 1.2}
+$w.zinc add text 1 -position {20 8} -alignment center -text {This static example reproduces figure 11-3
+of "The OpenGL Programming Guide 3rd Edition" V 1.2}
set group [$w.zinc add group 1]
@@ -42,7 +45,7 @@ set curve1 [$w.zinc add curve $g1 {}]
$w.zinc contour $curve1 add +1 { 0 0 0 120 120 120 120 0 0 0}
$w.zinc contour $curve1 add +1 { 20 20 20 100 100 100 100 20 20 20}
$w.zinc contour $curve1 add +1 { 40 40 40 80 80 80 80 40 40 40}
-$w.zinc translate $g1 40 40
+$w.zinc translate $g1 100 100
set g2 [$w.zinc add group $group]
@@ -50,7 +53,7 @@ set curve2 [$w.zinc add curve $g2 {}]
$w.zinc contour $curve2 add +1 { 0 0 0 120 120 120 120 0 0 0}
$w.zinc contour $curve2 add -1 { 20 20 20 100 100 100 100 20 20 20}
$w.zinc contour $curve2 add -1 { 40 40 40 80 80 80 80 40 40 40}
-$w.zinc translate $g2 200 40
+$w.zinc translate $g2 260 100
set g3 [$w.zinc add group $group]
@@ -58,22 +61,25 @@ set curve3 [$w.zinc add curve $g3 {}]
$w.zinc contour $curve3 add +1 { 20 0 20 120 100 120 100 0 20 0}
$w.zinc contour $curve3 add +1 { 40 20 60 120 80 20 40 20}
$w.zinc contour $curve3 add +1 { 0 60 0 80 120 80 120 60 0 60}
-$w.zinc translate $g3 360 40
+$w.zinc translate $g3 420 100
set g4 [$w.zinc add group $group]
set curve4 [$w.zinc add curve $g4 {}]
$w.zinc contour $curve4 add +1 { 0 0 0 140 140 140 140 60 60 60 60 80 80 80 80 40 40 40 40 100 100 100 100 20 20 20 20 120 120 120 120 0 0 0}
-$w.zinc translate $g4 520 40
+$w.zinc translate $g4 580 100
$w.zinc scale $group 0.6 0.6
-$w.zinc translate $group 80 20
+$w.zinc translate $group 80 40
-$w.zinc add text $group -position {-110 40} -text "contours\nand\nwinding\nnumbers"
-$w.zinc add text $group -position {-110 170} -text "winding\nrules"
+set t [$w.zinc add text $group -underlined yes -text "Contours"]
+$w.zinc translate $t 280 30
+set t [$w.zinc add text $group -underlined yes -text "-fillrule"]
+$w.zinc translate $t -110 30
set dy 0
foreach fillrule {odd nonzero positive negative abs_geq_2} {
set dy [expr $dy + 160]
- $w.zinc add text $group -position "-110 [expr 100+$dy]" -text $fillrule
+ set t [$w.zinc add text $group -text $fillrule]
+ $w.zinc translate $t -110 [expr 100+$dy]
foreach item "$curve1 $curve2 $curve3 $curve4" {
set clone [$w.zinc clone $item -fillrule $fillrule -filled 1]
$w.zinc translate $clone 0 $dy