Actual source code: ex15.c
petsc-3.8.4 2018-03-24
2: static char help[] = "Demonstrates PetscPopUpSelect()\n";
4: #include <petscsys.h>
7: int main(int argc,char **argv)
8: {
9: int ierr,choice;
10: const char *choices[] = {"Say hello","Say goodbye"};
12: PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;
13: PetscPopUpSelect(PETSC_COMM_WORLD,NULL,"Select one of ",2,choices,&choice);
14: PetscSynchronizedPrintf(PETSC_COMM_WORLD,"You selected %s\n",choices[choice]);
15: PetscSynchronizedFlush(PETSC_COMM_WORLD,PETSC_STDOUT);
16: PetscFinalize();
17: return ierr;
18: }