Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!fernwood!portal!sv!news From: leonardr@svc.portal.com (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: Idle and Hypercard 2.0 Message-ID: <1991Jan1.192341.28803@svc.portal.com> Date: 1 Jan 91 19:23:41 GMT References: <22363@well.sf.ca.us> Sender: news@svc.portal.com Reply-To: leonardr@svc.portal.com (Leonard Rosenthol) Organization: Software Ventures Corporation. Lines: 24 In article <22363@well.sf.ca.us>, wdh@well.sf.ca.us (Bill Hofmann) writes: > Here's a question, since MacDTS is on (gasp!) vacation. I have an XCMD > which sits in a loop waiting for a condition to match or a timer to expire, > but I'd like other processes *in* Hypercard to get time. (That is, GNE or > WNE won't do the trick.) Should I SendCardMessage(paramPtr, 'idle')? That > doesn't seem to work. Suggestions are welcome. > I don't believe you can, Bill. The problem is that Hypercard is not truely reentrant or multitasking, which is really what you want it to be. I see two solutions, one (as suggested elsewhere) is to make your XCMD create an XWindow (they can be invisible) and then do a SetXWIdleTime to get the nullEvents to do the tests you need. This will allow the rest of HC to continue and you can do what you need. If, for some reason, this is not acceptable, you may wish to try using the SendHCEvent and RunHandler callbacks (new with 2.0) which will allow you to pass back individual events (including nulls), and run specific handlers (like 'on idle') respectively. Leonard -- ---------------------------------------------------------------------- + Leonard Rosenthol | Internet: leonardr@sv.portal.com + + Software Ventures | GEnie: MACgician + + MicroPhone II Development Team | AOL: MACgician1 + ----------------------------------------------------------------------