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

Function mac_display_nhwindow

outdated/sys/mac/macwin.c:1295–1346  ·  view source on GitHub ↗

* display/select/update the window. * If f is true, this window should be "modal" - don't return * until presumed seen. */

Source from the content-addressed store, hash-verified

1293 * until presumed seen.
1294 */
1295void
1296mac_display_nhwindow(winid win, BOOLEAN_P f)
1297{
1298 NhWindow *aWin = &theWindows[win];
1299 WindowPtr theWindow = aWin->its_window;
1300
1301 if (win < 0 || win >= NUM_MACWINDOWS || !theWindow) {
1302 error("disp_win: Invalid window %d.", win);
1303 return;
1304 }
1305
1306 if (theWindow == _mt_window) {
1307 tty_display_nhwindow(win, f);
1308 return;
1309 }
1310
1311 if (f && inSelect == WIN_ERR && win == WIN_MESSAGE) {
1312 topl_set_resp((char *) 0, 0);
1313 if (aWin->windowTextLen > 0
1314 && (*aWin->windowText)[aWin->windowTextLen - 1] == CHAR_CR) {
1315 --aWin->windowTextLen;
1316 --aWin->y_size;
1317 }
1318 putstr(win, flags.standout ? ATR_INVERSE : ATR_NONE, " --More--");
1319 }
1320
1321 if (!IsWindowVisible(theWindow)) {
1322 if (win != WIN_MESSAGE)
1323 adjust_window_pos(aWin, aWin->x_size + SBARWIDTH + 1,
1324 aWin->y_size * aWin->row_height);
1325
1326 SelectWindow(theWindow);
1327 ShowWindow(theWindow);
1328 }
1329
1330 if (f && inSelect == WIN_ERR) {
1331 int ch;
1332
1333 DimMenuBar();
1334 inSelect = win;
1335 do {
1336 ch = mac_nhgetch();
1337 } while (!ClosingWindowChar(ch));
1338 inSelect = WIN_ERR;
1339 UndimMenuBar();
1340
1341 if (win == WIN_MESSAGE)
1342 topl_set_resp("", '\0');
1343 else
1344 HideWindow(theWindow);
1345 }
1346}
1347
1348void
1349mac_destroy_nhwindow(winid win)

Callers 4

enter_topl_modeFunction · 0.85
mac_doprev_messageFunction · 0.85
mac_putstrFunction · 0.85
mac_select_menuFunction · 0.85

Calls 6

tty_display_nhwindowFunction · 0.85
topl_set_respFunction · 0.85
adjust_window_posFunction · 0.85
mac_nhgetchFunction · 0.85
ClosingWindowCharFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected