#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: