(scalePtr, value)
| 1348 | * |
| 1349 | * SetScaleValue -- |
| 1350 | * |
| 1351 | * This procedure changes the value of a scale and invokes |
| 1352 | * a Tcl command to reflect the current position of a scale |
| 1353 | * |
| 1354 | * Results: |
| 1355 | * None. |
| 1356 | * |
| 1357 | * Side effects: |
| 1358 | * A Tcl command is invoked, and an additional error-processing |
| 1359 | * command may also be invoked. The scale's slider is redrawn. |
| 1360 | * |
| 1361 | *-------------------------------------------------------------- |
| 1362 | */ |
| 1363 | |
| 1364 | static void |
| 1365 | SetScaleValue(scalePtr, value) |
| 1366 | register Scale *scalePtr; /* Info about widget. */ |
| 1367 | int value; /* New value for scale. Gets |
| 1368 | * adjusted if it's off the scale. */ |
| 1369 | { |
| 1370 | int result; |
| 1371 | char string[20]; |
| 1372 | |
| 1373 | if ((value < scalePtr->fromValue) |
| 1374 | ^ (scalePtr->toValue < scalePtr->fromValue)) { |
| 1375 | value = scalePtr->fromValue; |
| 1376 | } |
| 1377 | if ((value > scalePtr->toValue) |
| 1378 | ^ (scalePtr->toValue < scalePtr->fromValue)) { |
| 1379 | value = scalePtr->toValue; |
| 1380 | } |
| 1381 | if (value == scalePtr->value) { |
| 1382 | return; |
no test coverage detected