Path: utzoo!utgpu!water!watmath!clyde!rutgers!ucla-cs!cit-vax!elroy!ames!nrl-cmf!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!leonardr From: leonardr@uxe.cso.uiuc.edu Newsgroups: comp.sys.mac Subject: Re: DA's Written in LSC Message-ID: <46100085@uxe.cso.uiuc.edu> Date: 18 Feb 88 21:21:00 GMT References: <9580@steinmetz.steinmetz.UUCP> Lines: 52 Nf-ID: #R:steinmetz.steinmetz.UUCP:9580:uxe.cso.uiuc.edu:46100085:000:2125 Nf-From: uxe.cso.uiuc.edu!leonardr Feb 18 15:21:00 1988 leue@galen.steinmetz(Bill Leue) writes in comp.sys.mac >I am probably the last person on earth to buy Lightspeed C, but I finally >have and I love it! After putting together a couple of trivial applications >as warm-up, I decided to write a Desk Accessory. The example "Windows" >DA supplied with LSC was helpful. Even more helpful was David Spector's >Generic DA (thanks, Dave!). > >However, there is a slight weirdness with Event handling. I am using the >default event mask which ought to let me get mouseDown, update, activate, >keyDown, and autoKey events. I DO get mouseDown events ok, but none of >the other events make it AS SUCH. If, however, I include a "default" >label in my event.what switch, then all the other events (update, etc.) fall >into this bin. The events my DA "sees" appear to be the ones I want, but >they all seem to have the same event code, and a non-standard one to boot. Here is portion of the code that I use in my SigmaEdit DA (written in LSC) for getting the event. I have no problems as you will see: DoEvent () { BlockMove (*((long *) & myParam->csParam[0]), &evtInfo.event, sizeof (EventRecord)); switch (evtInfo.event.what) { case mouseDown: DoClick (); break; case keyDown: case autoKey: DoKeyDown (); break; case updateEvt: DoUpdate (); break; case activateEvt: DoActivate (); break; } } Hope this helps.... +---------------------------------+-----------------------------------+ + + Any thing I say may be taken as + + Leonard Rosenthol + fact, then again you might decide+ + President, LazerWare, inc. + that it really isn't, so you + + + never know, do you?? + + leonardr@uxe.cso.uiuc.edu + + + GEnie: MACgician + + + Delphi: MACgician + + + + + +---------------------------------+-----------------------------------+