Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: ellery@trantor.harris-atd.com (Ellery Chan) Newsgroups: comp.sys.sun Subject: Re: How to clear CANVAS in sunview Keywords: Windows Message-ID: <8905091809.AA29087@trantor.harris-atd.com> Date: 12 May 89 04:12:29 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 17 Approved: Sun-Spots@rice.edu Original-Date: Tue, 9 May 89 14:09:50 EDT X-Sun-Spots-Digest: Volume 7, Issue 285, message 3 of 10 The easiest way that I know to clear a canvas is: pw_writebackground (canvas_pixwin(canvas), 0, 0, width, height, PIX_SRC); or, for color canvases: pw_writebackground (canvas_pixwin(canvas), 0, 0, width, height, PIX_SRC | PIX_COLOR(bg_color)); You only need to supply your own repaint procedure if you want to refresh the display manually when previously covered parts of your canvas become exposed. If CANVAS_RETAINED is set to TRUE, the canvas is repainted automatically from a backing pixrect kept in memory. I hope this helps. Ellery Chan | ARPA : ellery@trantor.harris-atd.com Harris Corp., MS 3A-1912 | USENET: ...!uunet!x102a!trantor!ellery PO Box 37, Melbourne, FL 32902 | AT&T : (407) 729-3364