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

Function MessageWidgetCmd

micropolis-activity/src/tk/tkmsg.c:253–287  ·  view source on GitHub ↗
(clientData, interp, argc, argv)

Source from the content-addressed store, hash-verified

251 *
252 *--------------------------------------------------------------
253 */
254
255static int
256MessageWidgetCmd(clientData, interp, argc, argv)
257 ClientData clientData; /* Information about message widget. */
258 Tcl_Interp *interp; /* Current interpreter. */
259 int argc; /* Number of arguments. */
260 char **argv; /* Argument strings. */
261{
262 register Message *msgPtr = (Message *) clientData;
263 int length;
264 char c;
265
266 if (argc < 2) {
267 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
268 " option ?arg arg ...?\"", (char *) NULL);
269 return TCL_ERROR;
270 }
271 c = argv[1][0];
272 length = strlen(argv[1]);
273 if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
274 if (argc == 2) {
275 return Tk_ConfigureInfo(interp, msgPtr->tkwin, configSpecs,
276 (char *) msgPtr, (char *) NULL, 0);
277 } else if (argc == 3) {
278 return Tk_ConfigureInfo(interp, msgPtr->tkwin, configSpecs,
279 (char *) msgPtr, argv[2], 0);
280 } else {
281 return ConfigureMessage(interp, msgPtr, argc-2, argv+2,
282 TK_CONFIG_ARGV_ONLY);
283 }
284 } else {
285 Tcl_AppendResult(interp, "bad option \"", argv[1],
286 "\": must be configure", (char *) NULL);
287 return TCL_ERROR;
288 }
289}
290

Callers

nothing calls this directly

Calls 3

Tcl_AppendResultFunction · 0.85
Tk_ConfigureInfoFunction · 0.85
ConfigureMessageFunction · 0.85

Tested by

no test coverage detected