home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / lisp / mcl / 1855 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  4.0 KB

  1. Path: sparky!uunet!stanford.edu!apple!cambridge.apple.com!jwbaxter@halcyon.halcyon.com
  2. From: jwbaxter@halcyon.halcyon.com
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: Apple Events
  5. Message-ID: <199212181629.AA26338@halcyon.com>
  6. Date: 18 Dec 92 16:32:56 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 83
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. >We're having some difficulty implementing Apple Event support in MCL 2.0p1.  
  12.  
  13. Tod,
  14.    There is some confusion as to what events are expected when an
  15. application starts up.  If the application is started because the
  16. application icon was double-clicked in Finder, an Open Application event is
  17. received.  If the app is started because one of its documents is double
  18. clicked, NO Open Application is received...an Open Document is received
  19. instead.  (Or a Print Document if a document is selected in Finder and the
  20. Print command is chosen.).
  21.    So...when an application starts up and observes that Apple events are
  22. implemented, it should do whatever it does to initialize REGARDLESS of why
  23. it is starting, then await one of the events.  On Open App do the "I was
  24. double-clicked" stuff (untitled document, or whatever)...on Open Doc do
  25. that stuff.
  26.    None of the events will be received if the right bit isn't set in the
  27. SIZE resource (but if that were the problem you wouldn't get the Quit
  28. Application event either, and that shouldn't be the MCL problem you're
  29. seeing).
  30.  
  31.    On the CD ROM, look in folder Dev.CD Nov/Dec 92:Tools &
  32. Apps:OS/Toolbox:Apple Events:AETracker 3.0: for a nice little Control Panel
  33. which patches the trap which all Apple event traps go through, and will
  34. report some or lots of information about some or all of the calls (easy to
  35. select what).  It should answer many of your questions about what events
  36. are being passed around.  $5 shareware from one of the Apple DTS guys.
  37.  
  38.    Also on the CD ROM, in Dev.CD Nov/Dec 92:Tools & Apps:OS/Toolbox:Apple
  39. Events:AE & Scripting Dev Kit:AE Tools:FKEYs: there is a nice FKey which
  40. displays a list of the currently installed Apple event handlers.  Useful
  41. sometimes if you "know" you're set up to receive an event which isn't
  42. coming in.  Also useful to make sure that any System handlers are being
  43. removed when an application shuts down (I've found two guilty apps so far).
  44.  
  45.    None of what I've said above is directly related to MCL.  I see that MCL
  46. installs one wildcard handler which receives all incoming events (that's
  47. the little FKey at work).  I haven't looked at what that handler does.
  48. ------------
  49.    After running the AETracker against MCL 2.0p1, I have a concern:
  50. ------------
  51. AETracker record
  52. Brought to you by C.K. Haun <TR> and RavenWare Software
  53. Tracking initiated in application:Finder 
  54.  
  55. MCL 2.0p1 at TickCount: $0000298D
  56. AEInstallEventHandler
  57. Class:  aevt ID: **** RefCon  $010DE76C System Type
  58.  
  59. MCL 2.0p1 at TickCount: $00002990
  60. AEProcessAppleEvent
  61. Class:  aevt ID: oapp
  62.  
  63. MCL 2.0p1 at TickCount: $00002990
  64. AEGetAttributePtr
  65. Wanting: Descriptor Type:**** Key Type :  evid
  66.  
  67. MCL 2.0p1 at TickCount: $00002991
  68. AEGetAttributePtr
  69. Wanting: Descriptor Type:**** Key Type :  miss
  70. Routine returned an error : $F95B errAEDescNotFound
  71.  
  72. MCL 2.0p1 at TickCount: $00002991
  73. AERemoveEventHandler
  74. Class:  aevt ID: ****
  75.  
  76. MCL 2.0p1 at TickCount: $00002ACF
  77. AEInstallEventHandler
  78. Class:  **** ID: **** RefCon  $00000000 System Type
  79. -------------------
  80. This is the result of double clicking MCL itself.  Note that MCL seems to
  81. be installing a bogus handler (which seems to work) to catch event class
  82. <<nothing>> (probably 0x00000000), ID **** (typeWildCard).  (Or, there
  83. could be a problem in AETracker, but I've never before seen it mis-report
  84. an event Class.)  The Open Application arrives and is processed, the bogus
  85. handler is removed and a new, valid handler for **** **** is installed.
  86.  
  87. I haven't looked at the underlying code, but I suspect the root of your
  88. problem is in this use of a different handler at startup.
  89.    --John
  90.  
  91. --------------
  92. John W. Baxter   jwbaxter@halcyon.com   [BAXTER.JOHN on AppleLink, from
  93. AppleLink only.]
  94.