Menu.h 586 B

123456789101112131415161718192021222324252627
  1. #include <menu.h>
  2. #include "main.h"
  3. #include "Curses.h"
  4. #ifndef _MENU_HEADER_
  5. #define _MENU_HEADER_
  6. typedef struct { char* name; char* description; } menu_entry;
  7. static menu_entry MenuEntries[] = {
  8. { "New", "Start a new game." },
  9. { "Load", "Load a saved game." },
  10. { "Quit", "Exit the game." },
  11. };
  12. #define NCHOICES ARRAY_SIZE(MenuEntries)
  13. typedef ITEM* item;
  14. typedef item* items;
  15. typedef struct Menu {
  16. window win;
  17. items choices;
  18. MENU* framework;
  19. } Menu;
  20. typedef struct Menu* menu;
  21. menu CreateMenu();
  22. void PurgeMenu( menu m );
  23. void LaunchMenu();
  24. #endif