aboutsummaryrefslogtreecommitdiff
path: root/demos/tiger.tcl
diff options
context:
space:
mode:
authorlecoanet2003-04-16 09:43:32 +0000
committerlecoanet2003-04-16 09:43:32 +0000
commiteed2656db0adae2c234c3d74af0913746ed5c444 (patch)
treef2821633165f1caf635a7e77708aeda998786c10 /demos/tiger.tcl
parentc0dc6e04d97b53185eda9bbd68900eba15ae1f84 (diff)
downloadtkzinc-eed2656db0adae2c234c3d74af0913746ed5c444.zip
tkzinc-eed2656db0adae2c234c3d74af0913746ed5c444.tar.gz
tkzinc-eed2656db0adae2c234c3d74af0913746ed5c444.tar.bz2
tkzinc-eed2656db0adae2c234c3d74af0913746ed5c444.tar.xz
Many updates for the 3.2.90 release and new demos
Diffstat (limited to 'demos/tiger.tcl')
-rw-r--r--demos/tiger.tcl22
1 files changed, 11 insertions, 11 deletions
diff --git a/demos/tiger.tcl b/demos/tiger.tcl
index 74b455c..008d68d 100644
--- a/demos/tiger.tcl
+++ b/demos/tiger.tcl
@@ -12,13 +12,13 @@ if {![info exists zincDemo]} {
error "This script should be run from the zinc-widget demo."
}
-set w .textInput
+set w .tiger
catch {destroy $w}
toplevel $w
wm title $w "Zinc tiger (Generated from SVG) Demonstration"
wm iconname $w tiger
-set defaultfont "-adobe-helvetica-bold-r-normal-*-120-*-*-*-*-*-*"
+set defaultfont [font create -family Helvetica -size 10 -weight bold]
frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
@@ -32,7 +32,8 @@ pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
##########################################
zinc $w.zinc -width 600 -height 600 \
-font 9x15 -borderwidth 0 -backcolor grey90 \
- -render 1 -reshape 1 -fullreshape 1
+ -render 1
+# -reshape 1 -fullreshape 1
pack $w.zinc
set topGroup [$w.zinc add group 1]
@@ -42,10 +43,9 @@ Drag-Button 1 for moving the tiger,
Drag-Button 2 for zooming the tiger,
}
-set clip [$w.zinc add curve 1 { {0 150} {150 0} {470 20} {580 200}
- {600 300} {500 560} {50 550} {10 450} {100 480}} \
- -closed 1 -visible 0]
-$w.zinc itemconfigure 1 -clip $clip
+#set clip [$w.zinc add curve 1 { {0 150} {150 0} {470 20} {580 200}
+# {600 300} {500 560} {50 550} {10 450} {100 480}} -closed 1 -visible 0]
+#$w.zinc itemconfigure 1 -clip $clip
$w.zinc add text 1 -position {51 521} -anchor w \
-priority 20 -text $text -color white
@@ -561,7 +561,7 @@ proc motion {x y} {
}
proc zoom {x y} {
- global w topGroup curX curY
+ global w curX curY
if {$x > $curX} {
set maxX $x
@@ -578,16 +578,16 @@ proc zoom {x y} {
}
set sx [expr 1.0 + (double($x - $curX) / $maxX)]
set sy [expr 1.0 + (double($y - $curY) / $maxY)]
- $w.zinc scale $topGroup $sx $sx
+ $w.zinc scale __svg__1 $sx $sx
set curX $x
set curY $y
}
proc mouseRotate {x y} {
- global w curAngle topGroup
+ global w curAngle
set lAngle [expr atan2($y, $x)]
- $w.zinc rotate $topGroup [expr $lAngle - $curAngle]
+ $w.zinc rotate __svg__1 [expr $lAngle - $curAngle]
set curAngle $lAngle
}