/* * Redraw * ------ * This program draws two rectangles in a window's call-back function. * If the window is redrawn for some reason, the rectangle will * automatically be redrawn. */ #include void draw_window(window w, rect win_rect) { rect r = rect(10,10,80,10); setcolour(Red); drawrect(r); setcolour(Blue); fillrect(rect(10,40,80,10)); } void main(void) { window w; w = newwindow("Rectangles", rect(0,0,200,150), StandardWindow); setredraw(w, draw_window); show(w); mainloop(); }