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