MCPcopy Create free account
hub / github.com/SimHacker/micropolis / SetScaleValue

Function SetScaleValue

micropolis-activity/src/tk/tkscale.c:1350–1379  ·  view source on GitHub ↗
(scalePtr, value)

Source from the content-addressed store, hash-verified

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
1364static void
1365SetScaleValue(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;

Callers 3

ScaleWidgetCmdFunction · 0.85
ConfigureScaleFunction · 0.85
ScaleMouseProcFunction · 0.85

Calls 3

EventuallyRedrawScaleFunction · 0.85
TkBindErrorFunction · 0.85
Tcl_VarEvalFunction · 0.50

Tested by

no test coverage detected