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

Function mswin_select_menu

win/win32/mswproc.c:1227–1245  ·  view source on GitHub ↗

int select_menu(windid window, int how, menu_item **selected) -- Return the number of items selected; 0 if none were chosen, -1 when explicitly cancelled. If items were selected, then selected is filled in with an allocated array of menu_item structures, one for each selected line. The caller must free th

Source from the content-addressed store, hash-verified

1225 create_nhwindow() time.
1226*/
1227int
1228mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected)
1229{
1230 int nReturned = -1;
1231
1232 logDebug("mswin_select_menu(%d, %d)\n", wid, how);
1233
1234 if ((wid >= 0) && (wid < MAXWINDOWS)
1235 && (GetNHApp()->windowlist[wid].win != NULL)) {
1236 ShowWindow(GetNHApp()->windowlist[wid].win, SW_SHOW);
1237 nReturned = mswin_menu_window_select_menu(
1238 GetNHApp()->windowlist[wid].win, how, selected,
1239 !(iflags.perm_invent && wid == WIN_INVEN
1240 && how == PICK_NONE) /* don't activate inventory window if
1241 perm_invent is on */
1242 );
1243 }
1244 return nReturned;
1245}
1246
1247/*
1248 -- Indicate to the window port that the inventory has been changed.

Callers

nothing calls this directly

Calls 3

logDebugFunction · 0.70
GetNHAppFunction · 0.70

Tested by

no test coverage detected