aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testpoly.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/testpoly.tcl')
-rw-r--r--sandbox/testpoly.tcl20
1 files changed, 14 insertions, 6 deletions
diff --git a/sandbox/testpoly.tcl b/sandbox/testpoly.tcl
index 09209e8..0b3edf7 100644
--- a/sandbox/testpoly.tcl
+++ b/sandbox/testpoly.tcl
@@ -1,6 +1,6 @@
-#!/usr/bin/wish8.0 -f
+#!/usr/local/bin/wish -f
-load tkzinc3.1.so
+load ../tkzinc3.2.so
package require Img
set top 1
@@ -30,7 +30,7 @@ set show {\
{round round t 0 flat Fill}\
{round round t 1 flat FillBorder}}
-image create photo logo -file /usr/share/toccata/images/logo.gif
+image create photo logo -file logo.gif
#image create photo papier -file /usr/share/toccata/images/dgtexture-dragstrip.xpm
set r [zinc .r -backcolor gray -relief sunken -render 0]
@@ -57,17 +57,25 @@ set y [expr [lindex $bbox 1] + 5]
#
# Now clone for each variation on the polygon
#
+proc linecol { relief } {
+ if {[string compare $relief flat]} {
+ return yellow
+ } else {
+ return tan
+ }
+}
+
set col 0
set row 0
foreach current $show {
foreach {cap join filled border relief title} $current {
set grp [.r clone $model]
.r translate $grp [expr $col * 240] [expr $row * (-290 - (2 * $lw))]
- .r itemconfigure [.r find withtag "poly" $grp] \
+ .r itemconfigure [.r find withtag "$grp*poly"] \
-capstyle $cap -joinstyle $join -filled $filled \
-linewidth [expr $border ? $lw : 0] -relief $relief \
- -linecolor [expr $relief == flat ? yellow : tan]
- .r itemconfigure [.r find withtag "title" $grp] -text $title
+ -linecolor [linecol $relief]
+ .r itemconfigure [.r find withtag "$grp*title"] -text $title
incr col
if {$col >= 4} {
set col 0