/* * Make a Drawing Area * ------------------- * This program creates a drawing area on a window, * and shows how to use the redraw callback to draw * something into that drawing area. */ #include void draw_shapes(drawing d, rect r) { setcolour(Red); drawrect(r); setcolour(Blue); fillrect(rect(10,40,80,10)); } void main(void) { window w; drawing d; rect r; w = newwindow("Rectangles", rect(50,50,150,200), StandardWindow); setbackground(w, LightGrey); r = rect(10,10,100,100); d = newdrawing(r, draw_shapes); show(w); mainloop(); }