Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!tcdcs!bofin!cjmchale From: cjmchale@cs.tcd.ie (Ciaran McHale) Newsgroups: comp.windows.x Subject: Re: XDrawLine event driven ? Message-ID: <1991Mar4.112554.5459@cs.tcd.ie> Date: 4 Mar 91 11:25:54 GMT References: <1991Mar3.231115@csd.uwo.ca> Organization: DSG, Dept. of Comp. Sci., Trinity College, Dublin. Lines: 37 In <1991Mar3.231115@csd.uwo.ca> bradd@csd.uwo.ca (krusty the klown) writes: >Whenever a window appears over the lines and disappears, or the >application is iconified, the lines (or portions of) disappear. >I suppose this is because the lines from XDrawLine are not >event driven (ie: no auto refresh). An application is responsible for redrawing (parts of) any of its windows which have become obscured and then re-exposed. What you should do is look out for Expose events and then redraw the window's contents. The Expose event data structure contains information to tell you which portion of the window you need to redraw so you only have to redraw the necessary section. Oliver Jones' book on Xlib programming has some good examples and advice on how to handle Expose events. It might be of some use. From the monthly X bibliography popting... Jones, Oliver, Introduction to the X Window System, Prentice-Hall, 1988, 1989. ISBN 0-13-499997-5. An excellent introduction to programming with Xlib. Written with the programmer in mind, this book includes many practical tips that are not found anywhere else. This book is not as broad as the O'Reilly Xlib tutorial and doesn't offer as many exam- ples as the Johnson & Reichard book, but Jones is probably the most experienced X programmer of this group and this shows in the quality and depth of the material in the book. Originally written for X11R1, recent printings have included corrections and additions. The sixth printing should have X11R4 material. Ciaran. -- Ciaran McHale "Verbosity says it all" ____ Department of Computer Science, Trinity College, Dublin 2, Ireland. \ / Telephone: +353-1-772941 ext 1538 FAX: +353-1-772204 \/ Telex: 93782 TCD EI email: cjmchale@cs.tcd.ie