summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c2
-rw-r--r--src/H5Tconv.c4
-rw-r--r--src/H5Tpkg.h11
-rw-r--r--src/H5config.h.in4
4 files changed, 2 insertions, 19 deletions
diff --git a/src/H5T.c b/src/H5T.c
index f5332ad..293a1d6 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1276,10 +1276,8 @@ H5T_init_interface(void)
status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_dxpl_id, FALSE);
/* From floats to long long */
-#if H5T_CONV_INTERNAL_FP_LLONG
status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_dxpl_id, FALSE);
status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_dxpl_id, FALSE);
-#endif /* H5T_CONV_INTERNAL_FP_LLONG */
#ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG
status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_dxpl_id, FALSE);
#endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index dbb9c8d..cb9a04a 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -8653,7 +8653,6 @@ H5_GCC_DIAG_ON(float-equal)
*
*-------------------------------------------------------------------------
*/
-#if H5T_CONV_INTERNAL_FP_LLONG
herr_t
H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8664,7 +8663,6 @@ H5_GCC_DIAG_OFF(float-equal)
H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX);
H5_GCC_DIAG_ON(float-equal)
}
-#endif /* H5T_CONV_INTERNAL_FP_LLONG */
/*-------------------------------------------------------------------------
@@ -8707,7 +8705,6 @@ H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*
*-------------------------------------------------------------------------
*/
-#if H5T_CONV_INTERNAL_FP_LLONG
herr_t
H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8718,7 +8715,6 @@ H5_GCC_DIAG_OFF(float-equal)
H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX);
H5_GCC_DIAG_ON(float-equal)
}
-#endif /*H5T_CONV_INTERNAL_FP_LLONG*/
/*-------------------------------------------------------------------------
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 958462b..0b0cd61 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -126,18 +126,11 @@
#define H5T_CONV_INTERNAL_ULLONG_LDOUBLE 1
#endif
-/* Define an internal macro for converting floating numbers to long long. The hard conversion on Windows
- * .NET 2003 has a bug and gives wrong exception value. */
-#if (H5_WANT_DATA_ACCURACY && !defined(H5_HW_FP_TO_LLONG_NOT_WORKS)) || (!H5_WANT_DATA_ACCURACY)
-#define H5T_CONV_INTERNAL_FP_LLONG 1
-#endif
-
/* Define an internal macro for converting long double to long long. SGI compilers give some incorrect
* conversions. Mac OS 10.4 gives incorrect conversions. HP-UX 11.00 compiler generates floating exception.
* The hard conversion on Windows .NET 2003 has a bug and gives wrong exception value. */
-#if (H5_WANT_DATA_ACCURACY && !defined(H5_HW_FP_TO_LLONG_NOT_WORKS) && \
- defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || \
- (!H5_WANT_DATA_ACCURACY && !defined(H5_HW_FP_TO_LLONG_NOT_WORKS))
+#if (H5_WANT_DATA_ACCURACY && defined(H5_LDOUBLE_TO_LLONG_ACCURATE)) || \
+ (!H5_WANT_DATA_ACCURACY)
#define H5T_CONV_INTERNAL_LDOUBLE_LLONG 1
#endif
diff --git a/src/H5config.h.in b/src/H5config.h.in
index a13a31f..cd8886c 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -363,10 +363,6 @@
/* Define to 1 if you have the `_scrsize' function. */
#undef HAVE__SCRSIZE
-/* Define if your system can't handle converting floating-point values to long
- long. */
-#undef HW_FP_TO_LLONG_NOT_WORKS
-
/* Define if HDF5's high-level library headers should be included in hdf5.h */
#undef INCLUDE_HL
d Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-06-14 10:56:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-06-14 10:56:58 (GMT)
commitcfa85ce7321d315e312a7bb23d4cdf0b2d666f47 (patch)
treeab207a698a3ec34347d9ed68baa80cb2825a3bd1 /library/demos
parent019ad61b8b1833368240e189ad1b47b00feaab4c (diff)
downloadtk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.zip
tk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.tar.gz
tk-cfa85ce7321d315e312a7bb23d4cdf0b2d666f47.tar.bz2
Added braces to expressions.
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/arrow.tcl89
-rw-r--r--library/demos/clrpick.tcl4
-rw-r--r--library/demos/cscroll.tcl16
-rw-r--r--library/demos/ctext.tcl39
-rw-r--r--library/demos/filebox.tcl6
-rw-r--r--library/demos/floor.tcl4
-rw-r--r--library/demos/hscale.tcl4
-rw-r--r--library/demos/items.tcl4
-rw-r--r--library/demos/plot.tcl17
-rw-r--r--library/demos/puzzle.tcl8
-rw-r--r--library/demos/ruler.tcl18
-rw-r--r--library/demos/twind.tcl21
-rw-r--r--library/demos/vscale.tcl4
13 files changed, 119 insertions, 115 deletions
diff --git a/library/demos/arrow.tcl b/library/demos/arrow.tcl
index 78befc3..5d37233 100644
--- a/library/demos/arrow.tcl
+++ b/library/demos/arrow.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a canvas widget that displays a
# large line with an arrowhead whose shape can be edited interactively.
#
-# RCS: @(#) $Id: arrow.tcl,v 1.2 1998/09/14 18:23:26 stanton Exp $
+# RCS: @(#) $Id: arrow.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -33,68 +33,69 @@ proc arrowSetup c {
# Create the arrow and outline.
$c delete all
- eval "$c create line $v(x1) $v(y) $v(x2) $v(y) -width [expr 10*$v(width)] \
- -arrowshape {[expr 10*$v(a)] [expr 10*$v(b)] [expr 10*$v(c)]} \
- -arrow last $v(bigLineStyle)"
- set xtip [expr $v(x2)-10*$v(b)]
- set deltaY [expr 10*$v(c)+5*$v(width)]
- $c create line $v(x2) $v(y) $xtip [expr $v(y)+$deltaY] \
- [expr $v(x2)-10*$v(a)] $v(y) $xtip [expr $v(y)-$deltaY] \
+ eval {$c create line $v(x1) $v(y) $v(x2) $v(y) -arrow last \
+ -width [expr {10*$v(width)}] -arrowshape [list \
+ [expr {10*$v(a)}] [expr {10*$v(b)}] [expr {10*$v(c)}]]} \
+ $v(bigLineStyle)
+ set xtip [expr {$v(x2)-10*$v(b)}]
+ set deltaY [expr {10*$v(c)+5*$v(width)}]
+ $c create line $v(x2) $v(y) $xtip [expr {$v(y)+$deltaY}] \
+ [expr {$v(x2)-10*$v(a)}] $v(y) $xtip [expr {$v(y)-$deltaY}] \
$v(x2) $v(y) -width 2 -capstyle round -joinstyle round
# Create the boxes for reshaping the line and arrowhead.
- eval "$c create rect [expr $v(x2)-10*$v(a)-5] [expr $v(y)-5] \
- [expr $v(x2)-10*$v(a)+5] [expr $v(y)+5] $v(boxStyle) \
- -tags {box1 box}"
- eval "$c create rect [expr $xtip-5] [expr $v(y)-$deltaY-5] \
- [expr $xtip+5] [expr $v(y)-$deltaY+5] $v(boxStyle) \
- -tags {box2 box}"
- eval "$c create rect [expr $v(x1)-5] [expr $v(y)-5*$v(width)-5] \
- [expr $v(x1)+5] [expr $v(y)-5*$v(width)+5] $v(boxStyle) \
- -tags {box3 box}"
+ eval {$c create rect [expr {$v(x2)-10*$v(a)-5}] [expr {$v(y)-5}] \
+ [expr {$v(x2)-10*$v(a)+5}] [expr {$v(y)+5}] \
+ -tags {box1 box}} $v(boxStyle)
+ eval {$c create rect [expr {$xtip-5}] [expr {$v(y)-$deltaY-5}] \
+ [expr {$xtip+5}] [expr {$v(y)-$deltaY+5}] \
+ -tags {box2 box}} $v(boxStyle)
+ eval {$c create rect [expr {$v(x1)-5}] [expr {$v(y)-5*$v(width)-5}] \
+ [expr {$v(x1)+5}] [expr {$v(y)-5*$v(width)+5}] \
+ -tags {box3 box}} $v(boxStyle)
if {$cur != ""} {
eval $c itemconfigure $cur $v(activeStyle)
}
# Create three arrows in actual size with the same parameters
- $c create line [expr $v(x2)+50] 0 [expr $v(x2)+50] 1000 \
+ $c create line [expr {$v(x2)+50}] 0 [expr {$v(x2)+50}] 1000 \
-width 2
- set tmp [expr $v(x2)+100]
- $c create line $tmp [expr $v(y)-125] $tmp [expr $v(y)-75] \
+ set tmp [expr {$v(x2)+100}]
+ $c create line $tmp [expr {$v(y)-125}] $tmp [expr {$v(y)-75}] \
-width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
- $c create line [expr $tmp-25] $v(y) [expr $tmp+25] $v(y) \
+ $c create line [expr {$tmp-25}] $v(y) [expr {$tmp+25}] $v(y) \
-width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
- $c create line [expr $tmp-25] [expr $v(y)+75] [expr $tmp+25] \
- [expr $v(y)+125] -width $v(width) \
+ $c create line [expr {$tmp-25}] [expr {$v(y)+75}] [expr {$tmp+25}] \
+ [expr {$v(y)+125}] -width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
# Create a bunch of other arrows and text items showing the
# current dimensions.
- set tmp [expr $v(x2)+10]
- $c create line $tmp [expr $v(y)-5*$v(width)] \
- $tmp [expr $v(y)-$deltaY] \
+ set tmp [expr {$v(x2)+10}]
+ $c create line $tmp [expr {$v(y)-5*$v(width)}] \
+ $tmp [expr {$v(y)-$deltaY}] \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)+15] [expr $v(y)-$deltaY+5*$v(c)] \
+ $c create text [expr {$v(x2)+15}] [expr {$v(y)-$deltaY+5*$v(c)}] \
-text $v(c) -anchor w
- set tmp [expr $v(x1)-10]
- $c create line $tmp [expr $v(y)-5*$v(width)] \
- $tmp [expr $v(y)+5*$v(width)] \
+ set tmp [expr {$v(x1)-10}]
+ $c create line $tmp [expr {$v(y)-5*$v(width)}] \
+ $tmp [expr {$v(y)+5*$v(width)}] \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x1)-15] $v(y) -text $v(width) -anchor e
- set tmp [expr $v(y)+5*$v(width)+10*$v(c)+10]
- $c create line [expr $v(x2)-10*$v(a)] $tmp $v(x2) $tmp \
+ $c create text [expr {$v(x1)-15}] $v(y) -text $v(width) -anchor e
+ set tmp [expr {$v(y)+5*$v(width)+10*$v(c)+10}]
+ $c create line [expr {$v(x2)-10*$v(a)}] $tmp $v(x2) $tmp \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)-5*$v(a)] [expr $tmp+5] \
+ $c create text [expr {$v(x2)-5*$v(a)}] [expr {$tmp+5}] \
-text $v(a) -anchor n
- set tmp [expr $tmp+25]
- $c create line [expr $v(x2)-10*$v(b)] $tmp $v(x2) $tmp \
+ set tmp [expr {$tmp+25}]
+ $c create line [expr {$v(x2)-10*$v(b)}] $tmp $v(x2) $tmp \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)-5*$v(b)] [expr $tmp+5] \
+ $c create text [expr {$v(x2)-5*$v(b)}] [expr {$tmp+5}] \
-text $v(b) -anchor n
$c create text $v(x1) 310 -text "-width $v(width)" \
@@ -168,7 +169,7 @@ bind $c <Any-ButtonRelease-1> "arrowSetup $c"
proc arrowMove1 {c x y} {
upvar #0 demo_arrowInfo v
- set newA [expr ($v(x2)+5-round([$c canvasx $x]))/10]
+ set newA [expr {($v(x2)+5-round([$c canvasx $x]))/10}]
if {$newA < 0} {
set newA 0
}
@@ -176,7 +177,7 @@ proc arrowMove1 {c x y} {
set newA 25
}
if {$newA != $v(a)} {
- $c move box1 [expr 10*($v(a)-$newA)] 0
+ $c move box1 [expr {10*($v(a)-$newA)}] 0
set v(a) $newA
}
}
@@ -192,14 +193,14 @@ proc arrowMove1 {c x y} {
proc arrowMove2 {c x y} {
upvar #0 demo_arrowInfo v
- set newB [expr ($v(x2)+5-round([$c canvasx $x]))/10]
+ set newB [expr {($v(x2)+5-round([$c canvasx $x]))/10}]
if {$newB < 0} {
set newB 0
}
if {$newB > 25} {
set newB 25
}
- set newC [expr ($v(y)+5-round([$c canvasy $y])-5*$v(width))/10]
+ set newC [expr {($v(y)+5-round([$c canvasy $y])-5*$v(width))/10}]
if {$newC < 0} {
set newC 0
}
@@ -207,7 +208,7 @@ proc arrowMove2 {c x y} {
set newC 20
}
if {($newB != $v(b)) || ($newC != $v(c))} {
- $c move box2 [expr 10*($v(b)-$newB)] [expr 10*($v(c)-$newC)]
+ $c move box2 [expr {10*($v(b)-$newB)}] [expr {10*($v(c)-$newC)}]
set v(b) $newB
set v(c) $newC
}
@@ -224,7 +225,7 @@ proc arrowMove2 {c x y} {
proc arrowMove3 {c x y} {
upvar #0 demo_arrowInfo v
- set newWidth [expr ($v(y)+2-round([$c canvasy $y]))/5]
+ set newWidth [expr {($v(y)+2-round([$c canvasy $y]))/5}]
if {$newWidth < 0} {
set newWidth 0
}
@@ -232,7 +233,7 @@ proc arrowMove3 {c x y} {
set newWidth 20
}
if {$newWidth != $v(width)} {
- $c move box3 0 [expr 5*($v(width)-$newWidth)]
+ $c move box3 0 [expr {5*($v(width)-$newWidth)}]
set v(width) $newWidth
}
}
diff --git a/library/demos/clrpick.tcl b/library/demos/clrpick.tcl
index eee1d7e..5c1f018 100644
--- a/library/demos/clrpick.tcl
+++ b/library/demos/clrpick.tcl
@@ -2,7 +2,7 @@
#
# This demonstration script prompts the user to select a color.
#
-# RCS: @(#) $Id: clrpick.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $
+# RCS: @(#) $Id: clrpick.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -38,7 +38,7 @@ proc setColor {w button name options} {
set initialColor [$button cget -$name]
set color [tk_chooseColor -title "Choose a $name color" -parent $w \
-initialcolor $initialColor]
- if [string compare $color ""] {
+ if {[string compare $color ""]} {
setColor_helper $w $options $color
}
grab release $w
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index 0289911..8aad050 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a simple canvas that can be
# scrolled in two dimensions.
#
-# RCS: @(#) $Id: cscroll.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $
+# RCS: @(#) $Id: cscroll.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -48,9 +48,9 @@ set bg [lindex [$c config -bg] 4]
for {set i 0} {$i < 20} {incr i} {
set x [expr {-10 + 3*$i}]
for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
- $c create rect ${x}c ${y}c [expr $x+2]c [expr $y+2]c \
+ $c create rect ${x}c ${y}c [expr {$x+2}]c [expr {$y+2}]c \
-outline black -fill $bg -tags rect
- $c create text [expr $x+1]c [expr $y+1]c -text "$i,$j" \
+ $c create text [expr {$x+1}]c [expr {$y+1}]c -text "$i,$j" \
-anchor center -tags text
}
}
@@ -65,14 +65,14 @@ proc scrollEnter canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
set oldFill [lindex [$canvas itemconfig $id -fill] 4]
if {[winfo depth $canvas] > 1} {
$canvas itemconfigure $id -fill SeaGreen1
} else {
$canvas itemconfigure $id -fill black
- $canvas itemconfigure [expr $id+1] -fill white
+ $canvas itemconfigure [expr {$id+1}] -fill white
}
}
@@ -80,17 +80,17 @@ proc scrollLeave canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
$canvas itemconfigure $id -fill $oldFill
- $canvas itemconfigure [expr $id+1] -fill black
+ $canvas itemconfigure [expr {$id+1}] -fill black
}
proc scrollButton canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] < 0} {
- set id [expr $id+1]
+ set id [expr {$id+1}]
}
puts stdout "You buttoned at [lindex [$canvas itemconf $id -text] 4]"
}
diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl
index 51af609..fb120a8 100644
--- a/library/demos/ctext.tcl
+++ b/library/demos/ctext.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a canvas widget with a text
# item that can be edited and reconfigured in various ways.
#
-# RCS: @(#) $Id: ctext.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $
+# RCS: @(#) $Id: ctext.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -58,7 +58,7 @@ $c bind text <2> "textPaste $c @%x,%y"
# to be edited.
proc mkTextConfig {w x y option value color} {
- set item [$w create rect [expr $x] [expr $y] [expr $x+30] [expr $y+30] \
+ set item [$w create rect $x $y [expr {$x+30}] [expr {$y+30}] \
-outline black -fill $color -width 1]
$w bind $item <1> "$w itemconf text $option $value"
$w addtag config withtag $item
@@ -68,19 +68,20 @@ set x 50
set y 50
set color LightSkyBlue1
mkTextConfig $c $x $y -anchor se $color
-mkTextConfig $c [expr $x+30] [expr $y] -anchor s $color
-mkTextConfig $c [expr $x+60] [expr $y] -anchor sw $color
-mkTextConfig $c [expr $x] [expr $y+30] -anchor e $color
-mkTextConfig $c [expr $x+30] [expr $y+30] -anchor center $color
-mkTextConfig $c [expr $x+60] [expr $y+30] -anchor w $color
-mkTextConfig $c [expr $x] [expr $y+60] -anchor ne $color
-mkTextConfig $c [expr $x+30] [expr $y+60] -anchor n $color
-mkTextConfig $c [expr $x+60] [expr $y+60] -anchor nw $color
-set item [$c create rect [expr $x+40] [expr $y+40] [expr $x+50] [expr $y+50] \
+mkTextConfig $c [expr {$x+30}] [expr {$y }] -anchor s $color
+mkTextConfig $c [expr {$x+60}] [expr {$y }] -anchor sw $color
+mkTextConfig $c [expr {$x }] [expr {$y+30}] -anchor e $color
+mkTextConfig $c [expr {$x+30}] [expr {$y+30}] -anchor center $color
+mkTextConfig $c [expr {$x+60}] [expr {$y+30}] -anchor w $color
+mkTextConfig $c [expr {$x }] [expr {$y+60}] -anchor ne $color
+mkTextConfig $c [expr {$x+30}] [expr {$y+60}] -anchor n $color
+mkTextConfig $c [expr {$x+60}] [expr {$y+60}] -anchor nw $color
+set item [$c create rect \
+ [expr {$x+40}] [expr {$y+40}] [expr {$x+50}] [expr {$y+50}] \
-outline black -fill red]
$c bind $item <1> "$c itemconf text -anchor center"
-$c create text [expr $x+45] [expr $y-5] -text {Text Position} -anchor s \
- -font {Times 24} -fill brown
+$c create text [expr {$x+45}] [expr {$y-5}] \
+ -text {Text Position} -anchor s -font {Times 24} -fill brown
# Lastly, create some items that allow the text's justification to be
# changed.
@@ -89,10 +90,10 @@ set x 350
set y 50
set color SeaGreen2
mkTextConfig $c $x $y -justify left $color
-mkTextConfig $c [expr $x+30] [expr $y] -justify center $color
-mkTextConfig $c [expr $x+60] [expr $y] -justify right $color
-$c create text [expr $x+45] [expr $y-5] -text {Justification} -anchor s \
- -font {Times 24} -fill brown
+mkTextConfig $c [expr {$x+30}] $y -justify center $color
+mkTextConfig $c [expr {$x+60}] $y -justify right $color
+$c create text [expr {$x+45}] [expr {$y-5}] \
+ -text {Justification} -anchor s -font {Times 24} -fill brown
$c bind config <Enter> "textEnter $c"
$c bind config <Leave> "$c itemconf current -fill \$textConfigFill"
@@ -131,7 +132,7 @@ proc textB1Move {w x y} {
}
proc textBs {w} {
- if ![catch {$w dchars text sel.first sel.last}] {
+ if {![catch {$w dchars text sel.first sel.last}]} {
return
}
set char [expr {[$w index text insert] - 1}]
@@ -139,7 +140,7 @@ proc textBs {w} {
}
proc textDel {w} {
- if ![catch {$w dchars text sel.first sel.last}] {
+ if {![catch {$w dchars text sel.first sel.last}]} {
return
}
$w dchars text insert
diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl
index 9fd69fa..4401d06 100644
--- a/library/demos/filebox.tcl
+++ b/library/demos/filebox.tcl
@@ -2,7 +2,7 @@
#
# This demonstration script prompts the user to select a file.
#
-# RCS: @(#) $Id: filebox.tcl,v 1.2 1998/09/14 18:23:28 stanton Exp $
+# RCS: @(#) $Id: filebox.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -35,7 +35,7 @@ foreach i {open save} {
pack $f -fill x -padx 1c -pady 3
}
-if ![string compare $tcl_platform(platform) unix] {
+if {![string compare $tcl_platform(platform) unix]} {
checkbutton $w.strict -text "Use Motif Style Dialog" \
-variable tk_strictMotif -onvalue 1 -offvalue 0
pack $w.strict -anchor c
@@ -62,7 +62,7 @@ proc fileDialog {w ent operation} {
set file [tk_getSaveFile -filetypes $types -parent $w \
-initialfile Untitled -defaultextension .txt]
}
- if [string compare $file ""] {
+ if {[string compare $file ""]} {
$ent delete 0 end
$ent insert 0 $file
$ent xview end
diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl
index 0afb625..2435544 100644
--- a/library/demos/floor.tcl
+++ b/library/demos/floor.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a canvas widet that displays the
# floorplan for DEC's Western Research Laboratory.
#
-# RCS: @(#) $Id: floor.tcl,v 1.2 1998/09/14 18:23:28 stanton Exp $
+# RCS: @(#) $Id: floor.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -94,7 +94,7 @@ proc newRoom w {
proc roomChanged {w args} {
global currentRoom floorItems colors
$w delete highlight
- if [catch {set item $floorItems($currentRoom)}] {
+ if {[catch {set item $floorItems($currentRoom)}]} {
return
}
set new [eval \
diff --git a/library/demos/hscale.tcl b/library/demos/hscale.tcl
index fca7f20..a9b3761 100644
--- a/library/demos/hscale.tcl
+++ b/library/demos/hscale.tcl
@@ -2,7 +2,7 @@
#
# This demonstration script shows an example with a horizontal scale.
#
-# RCS: @(#) $Id: hscale.tcl,v 1.2 1998/09/14 18:23:28 stanton Exp $
+# RCS: @(#) $Id: hscale.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -38,7 +38,7 @@ $w.frame.scale set 75
proc setWidth {w width} {
incr width 21
- set x2 [expr $width - 30]
+ set x2 [expr {$width - 30}]
if {$x2 < 21} {
set x2 21
}
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index a91ab61..91ea32a 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a canvas that displays the
# canvas item types.
#
-# RCS: @(#) $Id: items.tcl,v 1.2 1998/09/14 18:23:29 stanton Exp $
+# RCS: @(#) $Id: items.tcl,v 1.3 2001/06/14 10:56:58 dkf Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -271,7 +271,7 @@ proc itemDrag {c x y} {
global lastX lastY
set x [$c canvasx $x]
set y [$c canvasy $y]
- $c move current [expr $x-$lastX] [expr $y-$lastY]
+ $c move current [expr {$x-$lastX}] [expr {$y-$lastY}]
set lastX $x
set lastY $y
}
diff --git a/library/demos/plot.tcl b/library/demos/plot.tcl