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

Function curses_add_menu

win/curses/cursmain.c:695–719  ·  view source on GitHub ↗

add_menu(winid wid, const glyph_info *glyphinfo, const anything identifier, char accelerator, char groupacc, int attr, int color, char *str, unsigned int itemflags) -- Add a text line str to the given menu window. If identifier is 0, th

Source from the content-addressed store, hash-verified

693 menu is displayed, set bit MENU_ITEMFLAGS_SELECTED.
694*/
695void
696curses_add_menu(winid wid, const glyph_info *glyphinfo,
697 const ANY_P *identifier,
698 char accelerator, char group_accel, int attr,
699 int clr, const char *str, unsigned itemflags)
700{
701 int curses_attr;
702
703 attr &= ~(ATR_URGENT | ATR_NOHISTORY);
704 curses_attr = curses_convert_attr(attr);
705
706 /* 'inv_update': 0 for normal menus, 1 and up for perminv window */
707 if (inv_update) {
708 /* persistent inventory window; nothing is selectable;
709 omit glyphinfo because perm_invent is to the side of
710 the map so usually cramped for horizontal space */
711 curs_add_invt(inv_update, accelerator, curses_attr, clr, str);
712 inv_update++;
713 return;
714 }
715
716 curses_add_nhmenu_item(wid, glyphinfo, identifier,
717 accelerator, group_accel,
718 curses_attr, clr, str, itemflags);
719}
720
721/*
722end_menu(window, prompt)

Callers 3

curses_character_dialogFunction · 0.85
curses_prev_mesgFunction · 0.85
curses_view_fileFunction · 0.85

Calls 3

curses_convert_attrFunction · 0.85
curs_add_invtFunction · 0.85
curses_add_nhmenu_itemFunction · 0.85

Tested by

no test coverage detected