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

Function curses_display_nhwindow

win/curses/cursmain.c:476–510  ·  view source on GitHub ↗

-- Display the window on the screen. If there is data pending for output in that window, it should be sent. If blocking is TRUE, display_nhwindow() will not return until the data has been displayed on the screen, and acknowledged by the user where appropriate. -- All calls are blocking in the tty window-po

Source from the content-addressed store, hash-verified

474 --more--, if necessary, in the tty window-port.
475*/
476void
477curses_display_nhwindow(winid wid, boolean block)
478{
479 menu_item *selected = NULL;
480 int border = curses_window_has_border(wid) ? 1 : 0;
481
482 if (wid == WIN_ERR)
483 return;
484 if (curses_is_menu(wid) || curses_is_text(wid)) {
485 curses_end_menu(wid, "");
486 (void) curses_select_menu(wid, PICK_NONE, &selected);
487 return;
488 }
489
490 /* don't overwrite the splash screen first time through */
491 if (!iflags.window_inited && wid == MAP_WIN) {
492 iflags.window_inited = TRUE;
493 } else {
494 WINDOW *win = curses_get_nhwin(wid);
495
496 /* actually display the window */
497 wnoutrefresh(win);
498 if (border)
499 box(win, 0, 0);
500 /* flush pending writes from other windows too */
501 doupdate();
502 }
503 if ((wid == MAP_WIN) && block) {
504 (void) curses_more();
505 }
506
507 if ((wid == MESSAGE_WIN) && block) {
508 (void) curses_block(TRUE);
509 }
510}
511
512
513/* Destroy will dismiss the window if the window has not

Callers

nothing calls this directly

Calls 8

curses_window_has_borderFunction · 0.85
curses_is_menuFunction · 0.85
curses_is_textFunction · 0.85
curses_end_menuFunction · 0.85
curses_select_menuFunction · 0.85
curses_get_nhwinFunction · 0.85
curses_moreFunction · 0.85
curses_blockFunction · 0.85

Tested by

no test coverage detected