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: