Changeset 5055 for branches/1.3/gui/scripts/gauge.tcl
- Timestamp:
- Mar 3, 2015, 1:28:40 PM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
- Property svn:mergeinfo changed
/branches/uiuc_vtk_viewers merged: 4952,4954,4991-4992,5032-5033,5049,5051-5053 /trunk merged: 4993,5054
- Property svn:mergeinfo changed
-
branches/1.3/gui/scripts/gauge.tcl
r3739 r5055 42 42 itk_option define -sampleheight sampleHeight SampleHeight 0 43 43 itk_option define -log log Log "" 44 itk_option define -validatecommand validateCommand ValidateCommand "" 44 45 45 46 constructor {args} { # defined below } … … 236 237 } 237 238 real { 238 239 240 241 242 243 239 # "scan" will reject the number if the string is "NaN" or 240 # "Inf" or the empty string. It also is accepts large numbers 241 # (e.g. 111111111111111111111) that "string is double" 242 # rejects. The problem with "scan" is that it doesn't care if 243 # there are extra characters trailing the number (eg. "123a"). 244 # The extra %s substitution is used to detect this case. 244 245 if { [scan $nv "%g%s" dummy1 dummy2] != 1 } { 245 246 error "bad value \"$nv\": should be a real number" … … 288 289 error "maximum value allowed here is $convMaxVal" 289 290 } 291 } 292 293 # 294 # If there's a -validatecommand option, then invoke the code 295 # now to check the new value. 296 # 297 if {[string length $itk_option(-validatecommand)] > 0} { 298 set cmd "uplevel #0 [list $itk_option(-validatecommand) [list $newval]]" 299 set result [eval $cmd] 290 300 } 291 301
Note: See TracChangeset
for help on using the changeset viewer.