home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <pcwproto.h>
- #include <menu.h>
-
- /* Declare the menu options */
-
- static PMNUFLDS poptions[] = {
- { '1', "1. Delete "},
- { '2', "2. Add "},
- { '3', "3. Change "},
- { 'E', "E. Exit "},
- { 0, (char *) 0}
- };
-
- /* Declare and initialize window info */
-
- PMNUTYPE pmenu = {
- NULL, /* Initial Window Pointer */
- 9, 25, 14, 55, /* Window boundries */
- BLACK, LIGHTGRAY, /* Window Color */
- DOUBLEALL,RED,LIGHTGRAY, /* Border type and border color */
- " Main Pop-up Menu ", /* Menu title */
- TOP,MIDDLE,BLUE,LIGHTGRAY, /* Title location & color */
- WHITE,BLUE, /* Select Bar color */
- 0, /* Initial bar position */
- poptions /* Pointer to array of options */
- };
-
- void main(void) {
-
- int i = 0, mxr, mxc;
- WNDPTR *menuwnd;
- static char *selections[] = {
- "Delete ",
- "Add ",
- "Change "
- };
-
- init_mouse();
- chk_video_state(&mxr,&mxc);
- menuwnd = makepmenu(&pmenu);
- while (i != 'E' && i != 27) {
- i = pmenuinput(&pmenu);
- switch(i) {
- case '1' :
- case '2' :
- case '3' :
- i -= 49;
- qputs(mxr,CENTER,WHITE,BLACK,selections[i]);
- break;
- default : break;
- }
- }
- if (mpresent) hide_mouse();
- menuwnd = wpop(menuwnd);
- }