MCPcopy Create free account
hub / github.com/NetHack/NetHack / adjust_status_fancy

Function adjust_status_fancy

win/X11/winstat.c:1263–1286  ·  view source on GitHub ↗

* This assumes several things: * + Status has only 2 lines * + That both lines are updated in succession in line order. * + We didn't set stringInPlace on the widget. */

Source from the content-addressed store, hash-verified

1261 * + We didn't set stringInPlace on the widget.
1262 */
1263void
1264adjust_status_fancy(struct xwindow *wp, const char *str)
1265{
1266 Arg args[2];
1267 Cardinal num_args;
1268
1269 if (!wp->status_information) {
1270 update_fancy_status(TRUE);
1271 return;
1272 }
1273
1274 if (wp->cursy == 0) {
1275 clear_text_buffer(&wp->status_information->text);
1276 append_text_buffer(&wp->status_information->text, str, FALSE);
1277 return;
1278 }
1279 append_text_buffer(&wp->status_information->text, str, FALSE);
1280
1281 /* Set new buffer as text. */
1282 num_args = 0;
1283 XtSetArg(args[num_args], XtNstring,
1284 wp->status_information->text.text); num_args++;
1285 XtSetValues(wp->w, args, num_args);
1286}
1287
1288/* Fancy ================================================================== */
1289extern const char *const hu_stat[]; /* from eat.c */

Callers 1

adjust_statusFunction · 0.85

Calls 3

update_fancy_statusFunction · 0.85
clear_text_bufferFunction · 0.85
append_text_bufferFunction · 0.85

Tested by

no test coverage detected