home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11727 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  2.8 KB

  1. Path: sparky!uunet!sequent!ogicse!usenet.coe.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!cs.utexas.edu!rutgers!cbmvax!peter
  2. From: peter@cbmvax.commodore.com (Peter Cherna)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: ASL and GadTools libraries.
  5. Message-ID: <33732@cbmvax.commodore.com>
  6. Date: 28 Jul 92 16:05:54 GMT
  7. Article-I.D.: cbmvax.33732
  8. References: <1992Jul27.191144.25772@wam.umd.edu>
  9. Reply-To: peter@cbmvax.commodore.com (Peter Cherna)
  10. Organization: Commodore-Amiga, Inc.  West Chester, PA.
  11. Lines: 45
  12.  
  13. In article <1992Jul27.191144.25772@wam.umd.edu> stark@wam.umd.edu (Mike Stark) writes:
  14. >When using the hook function to get messages from a shared IDCMP while an ASL
  15. >requester is displayed, it works to return a NULL pointer instead of the
  16. >pointer to the message ASL passed you. (The reason you would want to do this
  17. >is if you want to close the window with which the message is associated while
  18. >the ASL requester is displayed.)  The reason it is OK is that ASL calls
  19. >GT_ReplyIMsg which doesn't mind being passed a NULL pointer.
  20.  
  21. Those are mighty strong assumptions you're making.  How do you know that
  22. _all_ ASL does is GT_ReplyMsg()?  Suppose that in the future it has to
  23. do something else with it.
  24.  
  25. >The autdocs take a strong stance against doing this but it works.
  26.  
  27. Programming by that kind of credo is asking for trouble.  I cannot overemphasize
  28. the importance of heeding the documented warnings.
  29.  
  30. >I wish the autodocs said this was OK because I really want to let the user
  31. > of my program close windows while the ASL requester is active.
  32.  
  33. The autodocs WON'T say it's OK because it's NOT.  If you want to close
  34. the window while the requester is active, then don't pass your window
  35. in as a reference window.  It's pretty simple.
  36.  
  37. >GetMsg/GT_FilterIMsg/GT_PostFilterIMsg/ReplyMsg does not operate the same
  38. >as GT_GetIMsg/GT_ReplyIMsg.  In particular, if you are using the GT_Filter
  39. >routines, you start losing IDCMP_MOUSEMOVE events when you are using the
  40. >slider gadgets from GadTools.  I imagine that GadTools turns them off so as
  41. >not to get too far behind and GT_PostFilterIMsg doesn't turn them back on
  42. >again while GT_ReplyIMsg does. Go figure.
  43.  
  44. Your diagnosis is wrong.  GadTools never modifies IDCMP flags.  What
  45. you are doing wrong is failing to ReplyMsg() all the messages you get
  46. from GetMsg().  You probably only call ReplyMsg() when GT_FilterIMsg()
  47. returns non-NULL.  If you're using the filter functions, you must
  48. ReplyMsg() EVERYTHING you GetMsg().  That's your mistake.
  49.  
  50. >---Mike Stark                         | stark@umdhep.umd.edu
  51.  
  52.      Peter
  53. --
  54. Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc.
  55. {uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
  56. My opinions do not necessarily represent the opinions of my employer.
  57. "If we only use 15% of our brain, what do you suppose the other 75% is for?"
  58.