# Drawing Lines

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

    void redraw_it(Window *w, Graphics *g)
    {
      Point p1 = pt(10,10);
      Point p2 = pt(10,40);
      Point p3 = pt(50,40);

      draw_line(g, p1, p2);
      draw_line(g, p2, p3);
      draw_line(g, p3, p1);
    }

    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(redraw_it);
      show_window(w);
      main_loop(app);
      return 0;
    }

Notes:

- The `pt` function is used to specify mathematical points.
- The `draw_line` function draws lines between points.
- Use `on_window_redraw` to specify which function is called whenever the window needs to be redrawn.
- A `Graphics` object is used in drawing.
- `Points` are automatic (they are created on the stack) so there is no need to delete them.