[comp.sys.mac] DA's Written in LSC

spector@vx2.GBA.NYU.EDU (David HM Spector) (02/18/88)

Bill,


Hmmm...that is strange.  I just recompiled the version of GenericDA I had
sent to SUMEX-AIM way-back-when, and it seems to be OK, all of its events
get noticed.  I did notice that for some silly reason I neglected to set
the dCtlEMask though...(I don't recall why). 

Did you try setting the EMask by hand?  Perhaps an interaction with a particular
version of the system (I'm running under MultiFinder on a MacII)...?
Maybe the LSC glue is using one of the events that Apple took back (a *wild* 
guess I haven't looked... :-).

(I will post a newer version of GenericDA that has a few fixes and some useful
utility routines thrown in for good measure in the next few days...) 



			 Best regards,
 		           David

-------------------------------------------------------------------------------
David HM Spector				New York University
Senior Systems Programmer			Graduate School of Business
Arpa: SPECTOR@GBA.NYU.EDU			Academic Computing Center
UUCP:...!{allegra,rocky,harvard}!cmcl2!spector	90 Trinity Place, Rm C-4
MCIMail: DSpector				New York, New York 10006
AppleLink: D1161     CompuServe: 71260,1410     (212) 285-6080

leonardr@uxe.cso.uiuc.edu (02/19/88)

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             +                                   +
+                                 +                                   +
+---------------------------------+-----------------------------------+