home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / x / 19189 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  1.8 KB

  1. Xref: sparky comp.windows.x:19189 comp.windows.x.intrinsics:541
  2. Newsgroups: comp.windows.x,comp.windows.x.intrinsics
  3. Path: sparky!uunet!think.com!paperboy.osf.org!spinner.osf.org!drand
  4. From: drand@spinner.osf.org (Douglas S. Rand)
  5. Subject: Re: Event order: EnterNotify before Expose?
  6. Message-ID: <1992Nov16.161715.2540@osf.org>
  7. Sender: news@osf.org (USENET News System)
  8. Organization: Open Software Foundation
  9. References:  <BxoJ9I.L94@acsu.buffalo.edu>
  10. Date: Mon, 16 Nov 1992 16:17:15 GMT
  11. Lines: 36
  12.  
  13. In article <BxoJ9I.L94@acsu.buffalo.edu>, okeefe@cs.Buffalo.EDU (Paul O'Keefe) writes:
  14. |> 
  15. |> Implementing Tektronix-style crosshairs, I've run into a problem
  16. |> caused by the order in which events arrive.
  17. |> 
  18. |> Scenario:
  19. |> 
  20. |> An obscuring window in unmapped and the pointer "falls" into my app window.
  21. |> The EnterNotify arrives followed by an Expose event. 
  22. |> The EnterNotify handler draws the crosshairs in XOR mode.
  23. |> The Expose handler then overwrites part of the crosshairs
  24. |> so the original pixels can't be recovered.
  25. |> 
  26. |> Question 1:
  27. |> 
  28. |> One solution is for the EnterNotify handler to examine
  29. |> the event queue for Expose events and service them first.
  30. |> Is there another solution that's easier and/or better?
  31. |> 
  32. |> Question 2:
  33. |> 
  34. |> Does EnterNotify allows precede Expose in this scenario?
  35. |> If so why?
  36.  
  37. Who cares.  You should use the Enter and Leave events to set a 
  38. flag which turns the crosshairs on and off.  The Expose handler
  39. should draw them and a MotionNotify handler should track the
  40. cursor.  The Enter and Leave handlers should do no drawing.
  41.  
  42. My opinion.
  43.  
  44. -- 
  45. Douglas S. Rand <drand@osf.org>        OSF/Motif Dev.
  46. Snail:         11 Cambridge Center,  Cambridge,  MA  02142
  47. Disclaimer:    I don't know if OSF agrees with me... let's vote on it.
  48. Amateur Radio: KC1KJ
  49.