Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!usc!venera.isi.edu!raveling From: raveling@venera.isi.edu (Paul Raveling) Newsgroups: comp.windows.x Subject: Re: Handling expose events. Message-ID: <9415@venera.isi.edu> Date: 23 Aug 89 17:48:52 GMT References: <8908220058.AA08564@mote.umb.edu> <8908221732.AA28636@gaak.LCS.MIT.EDU> Reply-To: raveling@venera.isi.edu (Paul Raveling) Organization: Information Sciences Institute, Univ. of So. California Lines: 37 [original message not forwarded -- appears to be a response to a message I missed about finding a good technique to handle redrawing in response to an expose event] An easy technique with X11 (other than backing store) is to draw into a pixmap instead of the window, drawing only when necessary, and do an XCopyArea from pixmap to window. The XCopyArea is quite fast on our systems -- virtually instantantaneous on our HP 9000/370's. Code to respond to an Expose event is then quite simple. Here's a fragment from the X11 interface in our imglib source: expose = (XExposeEvent *) &sir -> event; /* Point to event data */ ... switch ( (sir->event).type ) { case Expose: /* Expose: Copy area from pixmap */ XCopyArea ( X11_env->display, sir->pix, sir->win, X11_env->gc, expose->x, expose->y, expose->width, expose->height, expose->x, expose->y ); break; case NoExpose: /* A couple noise events... */ case GraphicsExpose: ... ---------------- Paul Raveling Raveling@isi.edu