Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int bio_flag(const char* format, int row, int col, int* status, int radio){
- int done = 0;
- int key = -1;
- if (status) /* if status is non zero set to 1 */
- *status = !!(*status);
- while(!done) {
- bio_displayflag(format, row, col, *status);
- key = bio_getch();
- if (key > SPACE_KEY && key <= TILDA_KEY) bio_beep(); /* if key is any printable key, beep */
- else if (key >= F1_KEY && key <= F12_KEY) done = 1; /* if any function key is pressed, terminate the function */
- else if (key == SPACE_KEY) {
- if (radio)
- *status = 1;
- else
- *status = !(*status); /* toggle status between 0 and 1 */
- done = 1;
- }
- bio_displayflag(format, row, col, *status);
- }
- return key;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement