Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!kth.se!sunic!dkuug!modulex!morten From: morten@modulex.dk (Morten Hastrup) Newsgroups: comp.windows.x Subject: Re: XDrawLine event driven ? Message-ID: <721@modulex.dk> Date: 4 Mar 91 12:10:41 GMT References: <1991Mar3.231115@csd.uwo.ca> Organization: A/S MODULEX, Copenhagen, Denmark Lines: 42 bradd@csd.uwo.ca (krusty the klown) writes: >Thanks to all those who helped me out with XDrawLine. >I've managed to get real nifty looking lines on my screen, but there >is just one problem: >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). Yes, You are right. >For a solution, I attempted to figure out when an event such as >realizing a window or window movement occurs, but, unfortunately >I could not find/understand the required info from the Xt Intrinsic >or Xlib manuals. What you wanted to find is: Expose events! This type of event is occure whenever a window or an region of a window is exposed. That is your application (widget) should re-draw on such events. >Is this the best solution to this problem? What is the proper way >to check for the required events, and how should I go about >keeping those cool looking lines on my screen? This IS the way of doing it under X (Done exactly this way in widgets, Motif as well as Athena). You could do this in at least two ways. 1. Add an event handler to the expose event of you widnow (widget). Ie. XtAddEventHandler(). 2. Or, add an action/translation procedure to you widget. I prefer the last one - I think is more clear and I'm doing it this ways when I'm writing new widgets. Morten ----------------------------------------------------- Morten Hastrup | Email: morten@modulex.dk A/S MODULEX | Phone: +45 44 53 30 11 Lyskaer 15 | Telefax: +45 44 53 30 74 DK-2730 Herlev | Denmark |