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

Function create_status_window_fancy

win/X11/winstat.c:1158–1236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1156}
1157
1158void
1159create_status_window_fancy(struct xwindow *wp, /* window pointer */
1160 boolean create_popup, Widget parent)
1161{
1162 XFontStruct *fs;
1163 Arg args[8];
1164 Cardinal num_args;
1165 Position top_margin, bottom_margin, left_margin, right_margin;
1166
1167 wp->type = NHW_STATUS;
1168
1169 if (!create_popup) {
1170 /*
1171 * If we are not creating a popup, then we must be the "main" status
1172 * window.
1173 */
1174 if (!parent)
1175 panic("create_status_window_fancy: no parent for fancy status");
1176 wp->status_information = 0;
1177 wp->w = create_fancy_status(parent, (Widget) 0);
1178 return;
1179 }
1180
1181 wp->status_information =
1182 (struct status_info_t *) alloc(sizeof (struct status_info_t));
1183
1184 init_text_buffer(&wp->status_information->text);
1185
1186 num_args = 0;
1187 XtSetArg(args[num_args], XtNallowShellResize, False); num_args++;
1188 XtSetArg(args[num_args], XtNinput, False); num_args++;
1189
1190 wp->popup = parent = XtCreatePopupShell("status_popup",
1191 topLevelShellWidgetClass,
1192 toplevel, args, num_args);
1193 /*
1194 * If we're here, then this is an auxiliary status window. If we're
1195 * cancelled via a delete window message, we should just pop down.
1196 */
1197
1198 num_args = 0;
1199 XtSetArg(args[num_args], nhStr(XtNdisplayCaret), False); num_args++;
1200 XtSetArg(args[num_args], nhStr(XtNscrollHorizontal),
1201 XawtextScrollWhenNeeded); num_args++;
1202 XtSetArg(args[num_args], nhStr(XtNscrollVertical),
1203 XawtextScrollWhenNeeded); num_args++;
1204
1205 wp->w = XtCreateManagedWidget("status", /* name */
1206 asciiTextWidgetClass,
1207 parent, /* parent widget */
1208 args, /* set some values */
1209 num_args); /* number of values to set */
1210
1211 /*
1212 * Adjust the height and width of the message window so that it
1213 * is two lines high and COLNO of the widest characters wide.
1214 */
1215

Callers 1

create_status_windowFunction · 0.85

Calls 5

create_fancy_statusFunction · 0.85
init_text_bufferFunction · 0.85
nhFontHeightFunction · 0.85
panicFunction · 0.50
allocFunction · 0.50

Tested by

no test coverage detected