[comp.sys.mac] why applications should ask for mouseUp events

cs313s19@uhccux.UUCP (Cs313s19) (11/06/87)

Inside Macintosh's chapter on the Toolbox Event Manager recommends that
you always use "everyEvent" when calling GetNextEvent, so you get all
types of events.  I never thought this was important, until I neglected
to ask for "mouseUp" events in an application.

My program ignores certain mouseDown events (such as when you click in
part of a window which has no meaning).  When the corresponding mouseUp
event goes into the queue, it stays there.  (A mouseDown which is tracked
has its mouseUp consumed by something like MenuSelect or TrackControl.)

The problem: When I click on a menu, MenuSelect calls WaitMouseUp, to
see if there's been a mouseUp.  There *is* a mouseUp in the queue, so
MenuSelect stops tracking, and never draws the menu.  The mouseUp gets
consumed by this, *but* then I release the mouse when the menu fails to
track, and the number of queued mouseUps stays the same.  (Is there a
Law of Conservation of...?)

Similarly, controls always "fire" immediately, without tracking.  The feel
of this whole mess is sort of as if your mouse could never drag, only click.

When I changed my GetNextEvent call to ask for mouseUps, the problem
went away, of course.  Moral: Read the fine print.

 -- Mike Morton // P.O. Box 11378, Honolulu, HI  96878, (808) 456-8455 HST
      INTERNET: cs313s19@uhccux.uhcc.hawaii.edu
      UUCP:     {ihnp4,uunet,dcdwest,ucbvax}!sdcsvax!nosc!uhccux!cs313s19
      BITNET:   cs313s19%uhccux.uhcc.hawaii.edu@rutgers.edu