# Drawing Rectangles

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

    void redraw_it(Window *w, Graphics *g)
    {
      Rect r = rect(10,10,80,10);

      set_colour(g, RED);
      draw_rect(g, r);

      set_colour(g, BLUE);
      fill_rect(g, rect(10,40,80,10));
    }

    int main(int argc, char *argv[])
    {
      App *app = new_app(argc, argv);
      Window *w = new_window(app, rect(0,0,174,100),
                             "Graphics", STANDARD_WINDOW);
      on_window_redraw(w, redraw_it);
      show_window(w);
      main_loop(app);
      return 0;
    }

Notes:

- Use `rect(x,y,width,height)` to specify mathematical rectangles.
- Use `draw_rect` draws outlines of rectangles.
- Use `fill_rect` fills the rectangle with colour.
- Use `set_colour` to change the drawing colour.
- `Rects` are automatic (they are created on the stack) so there is no need to delete them.