home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / oop / macapp3 / 177 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  2.0 KB

  1. Path: sparky!uunet!stanford.edu!apple!applelink.apple.com
  2. From: D5087@AppleLink.Apple.COM (KR Software, Ken Ryall,PAS)
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: Re: MacApp demo code ?
  5. Message-ID: <724177567.6186308@AppleLink.Apple.COM>
  6. Date: 12 Dec 92 16:24:00 GMT
  7. Sender: usenet@Apple.COM
  8. Organization: AppleLink Gateway
  9. Lines: 34
  10.  
  11. Yeah, its really too bad that Object Model support got lost in the rush to
  12. Bedrock. However it's really not that hard to do yourself, but it does require
  13. modifying MacApp a good bit. But, I tell myself, since we'll never see a new
  14. version of MacApp, I might as well go to town on its source code.
  15.  
  16. Eric's article is a great example, but as you noted doesn't mention MacApp.
  17. This is not an accident, as I discovered when I linked him looking for advice
  18. on how to apply the same example to MacApp. He replied that a MacApp example
  19. "involves too much pain and anguish to deal with in a single
  20. article." After working on this a bit, I have to agree with him.
  21.  
  22. His advice for using the example in his artice with MacApp went like this:"
  23.  
  24. 1) Put all the MAppleObject behavior into TObject. For the pure virtual
  25. functions, write TObject implementations that call SubclassResponsibility.
  26. This will cause a runtime break, thus implementing the "pure virtualness" of
  27. the object.
  28.  
  29. 2) Change TApplication's handling of AppleEvents to check the direct object
  30. just as my C++ dispatcher object does. Dispatch to the appropriate object if
  31. it is an object model event, and to gApplication if not (ie: gApplication will
  32. always be the "default handler")."
  33.  
  34. This puts the basic structure in place for handling the Object Model, but
  35. doesn't implement default functionality for TWindow, TView,
  36. TEventHandler, TApplication, etc. Eric noted that this requires most of the
  37. work. It does, but is mostly tedious, not technically difficult.
  38.  
  39. Of course this does not address making the application recordable in addition
  40. to being scriptable. This will require some modifications to the TCommand
  41. system I'm sure, but I think I'll drive off that bridge when I come to it.
  42.  
  43. Ken Ryall
  44.  
  45.