Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!mips!apple!well!smoke From: smoke@well.sf.ca.us (Nicholas Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: GetNextEvent at beginning of App (was: Application startup window Q) Message-ID: <25385@well.sf.ca.us> Date: 11 Jun 91 23:58:37 GMT References: <1991Jun3.182417.2897@basho.uucp> <25235@well.sf.ca.us> <53745@apple.Apple.COM> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 28 In article <53745@apple.Apple.COM> greggor@Apple.COM (Greg L. Anderson) writes: >>If you're running under Multifinder on 6.x systems (or even if you're not), >>the 10 calls to GetNextEvent() make sure that your window and process >>are brought frontmost--an intermittent problem. > >Be careful about doing this on System 7; if your App just blindly calls >GetNextEvent(everyevent) a few times when it starts up, you'll lose all >of your open document high-level events if your app is AppleEvent aware. The sample code provided was calling GNE() with an eventmask permitting only updateEvents -- which avoids missed kHighLevelEvents (and other significant boot-time events: disk inserts, special boot keycodes, etc.), AND forces the toolbox to update any window the contents of which are defined by a windowPic (the query expressed by the original poster). >GetNextEvent( 0, &event ) might be an even better idea if it circumvents >the MF problem in 6.0.x; I haven't looked into it. I believe that it's >not necessary at all under System 7. That's correct--the problem is solved in System 7. -- --- * --- Nick Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink:KEY.EDUSOFT | (415) 548-2304 --- * ---