/* * Lines2 * ------ * This is another version of the lines.c program. It draws some * lines inside a call-back so they will not be erased by the * window becoming obscured. * * The setredraw function associates a redraw call-back with a * window, before the window is made visible by calling show. */ #include void draw_it(window w, rect r) { point a = pt(10,10); point b = pt(10,40); point c = pt(50,40); drawline(a, b); drawline(b, c); drawline(c, a); } void main(void) { window w; w = newwindow("Graphics", rect(20,20,100,80), StandardWindow); setredraw(w, draw_it); show(w); mainloop(); }