Dialog Boxes

#include "graphapp.h"

void main(void)
{
  char *name;
  int result;

  askok("Just testing");

  name = askstring("What is your name?", "Type it here");
  printf("Hello, %s\n", name);

  result = askokcancel("Destroy the world!");

  if (result == OK)
    printf("Destroying the world....\n");
  else if (result == CANCEL)
    printf("I'll destroy the world later.\n");

  result = askyesno("Would you like to play a game?");

  if (result == YES)
    printf("All right!\n");
  else if (result == NO)
    printf("Boring person.\n");

  result = askyesnocancel("Would you like to play Thermonuclear War?");

  switch (result) {
    case YES:    printf("BOOM!\n"); break;
    case NO:     printf("How about chess?\n"); break;
    case CANCEL: printf("Cancelled.\n"); break;
  }
}

Notes: