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

Function EntrySetValue

micropolis-activity/src/tk/tkentry.c:1188–1204  ·  view source on GitHub ↗
(entryPtr, value)

Source from the content-addressed store, hash-verified

1186 * Side effects:
1187 * The string displayed in the entry will change. Any selection
1188 * in the entry is lost and the insertion point gets set to the
1189 * end of the entry. Note: this procedure does *not* update the
1190 * entry's associated variable, since that could result in an
1191 * infinite loop.
1192 *
1193 *----------------------------------------------------------------------
1194 */
1195
1196static void
1197EntrySetValue(entryPtr, value)
1198 register Entry *entryPtr; /* Entry whose value is to be
1199 * changed. */
1200 char *value; /* New text to display in entry. */
1201{
1202 ckfree(entryPtr->string);
1203 entryPtr->numChars = strlen(value);
1204 entryPtr->string = (char *) ckalloc((unsigned) (entryPtr->numChars + 1));
1205 strcpy(entryPtr->string, value);
1206 entryPtr->selectFirst = entryPtr->selectLast = -1;
1207 entryPtr->leftIndex = 0;

Callers 2

ConfigureEntryFunction · 0.85
tkentry.cFile · 0.85

Calls 2

EntryUpdateScrollbarFunction · 0.85
EventuallyRedrawFunction · 0.70

Tested by

no test coverage detected