diff options
Diffstat (limited to 'tk/library/demos/twind.tcl')
-rw-r--r-- | tk/library/demos/twind.tcl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tk/library/demos/twind.tcl b/tk/library/demos/twind.tcl index 475cbd724bf..0a41c0d1e49 100644 --- a/tk/library/demos/twind.tcl +++ b/tk/library/demos/twind.tcl @@ -115,7 +115,7 @@ proc textWindOff w { proc textWindPlot t { set c $t.c - if [winfo exists $c] { + if {[winfo exists $c]} { return } canvas $c -relief sunken -width 450 -height 300 -cursor top_left_arrow @@ -129,20 +129,21 @@ proc textWindPlot t { for {set i 0} {$i <= 10} {incr i} { set x [expr {100 + ($i*30)}] $c create line $x 250 $x 245 -width 2 - $c create text $x 254 -text [expr 10*$i] -anchor n -font $font + $c create text $x 254 -text [expr {10*$i}] -anchor n -font $font } for {set i 0} {$i <= 5} {incr i} { set y [expr {250 - ($i*40)}] $c create line 100 $y 105 $y -width 2 - $c create text 96 $y -text [expr $i*50].0 -anchor e -font $font + $c create text 96 $y -text [expr {$i*50}].0 -anchor e -font $font } - foreach point {{12 56} {20 94} {33 98} {32 120} {61 180} - {75 160} {98 223}} { + foreach point { + {12 56} {20 94} {33 98} {32 120} {61 180} {75 160} {98 223} + } { set x [expr {100 + (3*[lindex $point 0])}] set y [expr {250 - (4*[lindex $point 1])/5}] - set item [$c create oval [expr $x-6] [expr $y-6] \ - [expr $x+6] [expr $y+6] -width 1 -outline black \ + set item [$c create oval [expr {$x-6}] [expr {$y-6}] \ + [expr {$x+6}] [expr {$y+6}] -width 1 -outline black \ -fill SkyBlue2] $c addtag point withtag $item } @@ -175,14 +176,14 @@ proc embPlotDown {w x y} { proc embPlotMove {w x y} { global embPlot - $w move selected [expr $x-$embPlot(lastX)] [expr $y-$embPlot(lastY)] + $w move selected [expr {$x-$embPlot(lastX)}] [expr {$y-$embPlot(lastY)}] set embPlot(lastX) $x set embPlot(lastY) $y } proc textWindDel w { set t $w.f.text - if [winfo exists $t.c] { + if {[winfo exists $t.c]} { $t delete $t.c while {[string first [$t get plot] " \t\n"] >= 0} { $t delete plot @@ -194,4 +195,3 @@ proc textWindDel w { proc embDefBg t { $t configure -background [lindex [$t configure -background] 3] } - |