Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!think!mintaka!bloom-beacon!rrkasegu From: rrkasegu@athena.mit.edu (Rick R. Kaseguma) Newsgroups: comp.sys.mac.programmer Subject: Re: Help! Keywords: jGNEFilter, GetNextEvent, events Message-ID: <1990Mar21.000232.18637@athena.mit.edu> Date: 21 Mar 90 00:02:32 GMT References: <45183.25FD20CE@cmhgate.FIDONET.ORG> <25ff4e70.643e@polyslo.CalPoly.EDU> <14463@reed.UUCP> <2735@hudson.acc.virginia.edu> Sender: news@athena.mit.edu (News system) Reply-To: rrkasegu@athena.mit.edu (Rick R. Kaseguma) Organization: Massachusetts Institute of Technology Lines: 40 It all started with a request for ideas of how to draw an icon in the menubar which causes an action when clicked (probably like OnCue). Then... In article <25ff4e70.643e@polyslo.CalPoly.EDU> rcfische@polyslo.CalPoly.EDU wrote: >...in the menu, even when the menu gets re-drawn. Then you might want >to look at hooking into GetNextEvent so that you can intercept mouse >downs and see if they're on your icon.... In article <14463@reed.UUCP> chaffee@reed.UUCP (Alex Chaffee) writes: >...A small suggestion - rather than patching GetNextEvent, take advantage of >the low-memory global jGNEFilter, which is sort of a built-in tail patch on >GNE. It's documeted in a tech note (I can't remember the number); I could >give you source code if you're interested... In article <2735@hudson.acc.virginia.edu> cak3g@astsun7.astro.Virginia.EDU (Colin Klipsch) writes make very useful comments on patching GNE, including: >...Patching GetNextEvent, as a method of event filtering, won't work >except as a tail patch, which is a Thing Not To Be Done. > >The scheme I use now is head-patching SystemEvent, which also seems to be >called after every event. SystemEvent is "guaranteed" to be supported, >and you don't have to share a precarious memory global with random >strangers... Wait! Why don't you just head patch MenuSelect? The point where the user clicked will be on the stack, and you won't be slowing everyone down by checking every single event. MenuSelect is called regardless of where you click in the menubar, and you can just drop through to the existing MenuSelect handler if the point is not in your icon's rectangle. You still have to worry about your A5 world, etc., but this seems like a much cleaner solution. Just an idea. Rick Kaseguma, Macintosh Programmer/Consultant/Bartender rrkasegu@athena.mit.edu (ARPA internet) 474 Memorial Drive, Cambridge, Massachusetts 02139 (617) 494-1286 (voice), (617) 225-7568 (voice/modem/fax)