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

  1. Path: sparky!uunet!stanford.edu!apple!applelink.apple.com
  2. From: ARTMA.DEV@AppleLink.Apple.COM (ARTMA Med.Tech.B Glattfelder,AT,IDV)
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: Re: Getting idle time
  5. Message-ID: <724522793.8215782@AppleLink.Apple.COM>
  6. Date: 16 Dec 92 16:08:00 GMT
  7. Sender: daemon@Apple.COM
  8. Organization: AppleLink Gateway
  9. Lines: 31
  10.  
  11.  
  12.  
  13. >My application has a window with a number of views in it.  One of those views
  14. >needs to get idle time so that a visual element within it can be animated.
  15.  
  16. The solution as well as the problem actually are contained in this statement:
  17. the visual element is to be animated, so it is the one who needs to get idle
  18. time. If it's feasible to introduce an auxiliary object deriving from
  19. TEventHandler in your design, this is an easy way to go. I have chosen that
  20. approach for playing movies in MacApp, where a TMovie object gets installed as
  21. a cohandler to animate the owning view (its theater).
  22.  
  23. Of course the first candidate object to handle idle messages that comes to a
  24. MacAppers mind is the view, but the target management of MacApp uses the same
  25. links in its chain as the cohandlers, and because a TView object always gets
  26. its Superview as its next handler, you would insert all the event handlers up
  27. to the TApplication object into the cohandler chain. Whether that's a good
  28. design is an other issue.
  29.  
  30. Now if the view really doesn't want to be target, you could probably detach it
  31. from its superview and install it as a cohandler to the application.  I don't
  32. encourage anybody to do so, and neither did I, but after some MacBrowse
  33. sessions I got pretty shure that setting the fNextHandler to  nil before
  34. calling gApplication->InstallCohandler should do the job.
  35.  
  36. Good luck
  37.  
  38. Beat Glattfelder
  39. ARTMA Biomedical Inc.
  40.  
  41.  
  42.