static int menu_virtualize(int c)
{
if (c == '\n' || c == KEY_EXIT)
return(MAX_COMMAND + 1);
else if (c == 'n' || c == KEY_DOWN)
return(REQ_NEXT_ITEM);
else if (c == 'p' || c == KEY_UP)
return(REQ_PREV_ITEM);
else
return(c);
}
int popup_menu(char *names[], int menu_y, int menu_x)
{
MENU *m;
ITEM **ip = items;
char **ap;
int mrows, mcols, n;
WINDOW *menuwin, *subwin;
int i;
for (ap = names; *ap; ap++)
*ip++ = new_item(*ap, "");
*ip = (ITEM *)NULL;