Vertical Button Layout

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

void quit(Control *c)
{
  exit(0);
}

int main(int argc, char *argv[])
{
  App *app;
  Window *w;
  Control *c;
  Control *b[5];
  Rect r;

  app = new_app(argc, argv);
  w = new_window(app, rect(50,50,120,145),
                 "Vertical Layout", STANDARD_WINDOW);
  r = rect(0,0,80,25);

  b[0] = new_button(w, r, "Quit", quit);
  r.y = r.y + 30;

  b[1] = new_button(w, r, "Button 1", quit);
  r.y = r.y + 30;

  b[2] = new_button(w, r, "Button 2", quit);
  r.y = r.y + 30;

  b[3] = new_button(w, r, "Button 3", quit);
  r.y = r.y + 30;

  b[4] = new_button(w, r, "Button 4", quit);
  r.y = r.y + 30;

  show_window(w);
  main_loop(app);
  return 0;
}

Notes: