# Dialog Windows

    #include <stdio.h>
    #include "graphapp.h"

    int main(int argc, char *argv[])
    {
      App *app;
      char *name;
      int result;

      app = new_app(argc, argv);

      ask_ok(app, "Information", "Just testing");

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

      result = ask_ok_cancel(app, "Question", "Destroy the world?");

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

      result = ask_yes_no(app, "Question",
                          "Would you like to play a game?");

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

      result = ask_yes_no_cancel(app, "Question",
                                 "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:

- Constants such as `OKAY`, `YES`, `NO` and `CANCEL` are returned from dialog windows which ask multiple choice questions.
- The string returned from `ask_string` should later be freed.
- All dialog windows accept a pointer to an `App` as their first parameter, and a window title string as the second parameter.