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

Function InvokeButton

micropolis-activity/src/tk/tkbutton.c:1368–1388  ·  view source on GitHub ↗
(butPtr)

Source from the content-addressed store, hash-verified

1366 * Results:
1367 * A standard Tcl return value. Information is also left in
1368 * interp->result.
1369 *
1370 * Side effects:
1371 * Depends on the button and its associated command.
1372 *
1373 *----------------------------------------------------------------------
1374 */
1375
1376static int
1377InvokeButton(butPtr)
1378 register Button *butPtr; /* Information about button. */
1379{
1380 if (butPtr->type == TYPE_CHECK_BUTTON) {
1381 if (butPtr->flags & SELECTED) {
1382 Tcl_SetVar(butPtr->interp, butPtr->selVarName, butPtr->offValue,
1383 TCL_GLOBAL_ONLY);
1384 } else {
1385 Tcl_SetVar(butPtr->interp, butPtr->selVarName, butPtr->onValue,
1386 TCL_GLOBAL_ONLY);
1387 }
1388 } else if (butPtr->type == TYPE_RADIO_BUTTON) {
1389 Tcl_SetVar(butPtr->interp, butPtr->selVarName, butPtr->onValue,
1390 TCL_GLOBAL_ONLY);
1391 }

Callers 1

ButtonWidgetCmdFunction · 0.85

Calls 1

Tcl_GlobalEvalFunction · 0.50

Tested by

no test coverage detected