home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / lisp / mcl / 1280 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  3.4 KB

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!lynch@ils.nwu.edu
  2. From: lynch@ils.nwu.edu
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: cell-select in sequence-dialog-items
  5. Message-ID: <9208201942.AA24074@aristotle.ils.nwu.edu>
  6. Date: 20 Aug 92 19:42:15 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 62
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Original-To: info-mcl@cambridge.apple.com
  11.  
  12. >I'm noticing that, contrary to my intuitive expectations,
  13. >sequence-dialog-items in MCL 2.0 do not call CELL-SELECT when the user
  14. >selects a cell by clicking on it.  Cells become highlighted and added
  15. >to the list returned by SELECTED-CELLS, but the CELL-SELECT method
  16. >itself does not appear to be called.
  17. >
  18. >I had hoped to specialize an :after method for this generic function
  19. >(and for cell-deselect) on a subclass of sequence-dialog-item that
  20. >would accomplish the behavior of activating a few buttons when and
  21. >only when one or more items in a table were selected.  It seems like
  22. >CELL-SELECT and CELL-DESELECT are a more logical place to put this
  23. >behavior than on VIEW-CLICK-EVENT-HANDLER, since sometimes cells might
  24. >be selected or deselected other than by clicking. (i.e. by typing
  25. >characters as in the select file dialog, or by program action)
  26.  
  27. A very common gotcha.
  28.  
  29. Unfortunately, this has been true and known to the MCL developers since AT
  30. LEAST MACL 1.3.2.  My advice is to just go ahead and bastardize
  31. view-click-event- handler...
  32.  
  33. UNLESS you think you really are going to use program action to select or
  34. deselect cells.  At that point, believe me, you are better off writing your
  35. own sequence-dialog-item.  Unfortunately, I did it the other way and regret
  36. it every time something comes up that has to be changed for the classes
  37. involved.
  38.  
  39. WARNING:  There are *other* methods that are for "external use only".  A
  40. colleague claims to have seen some sort of indication as to which were
  41. which in the documentation at some time, but I make no claims as to the
  42. truth-value of this statement as I avoid reading docs as much as possible. 
  43. :-)
  44.  
  45. I am unsure at this point which methods these are, but I seem to recall
  46. having serious fights with:
  47.  
  48. cell-select/cell-deselect (problems you noted above.)
  49. cell-position (I wanted to draw a deck of cards in fan-fold;  should be
  50. simple)
  51. cell-size?  (I'll be damned if I can remember how this screwed up.)
  52. view-[de]activate-event-handler
  53. (it frames[inverts] the rect of the selected cells;  I contend that should
  54. be
  55.  done by draw-cell-contents for modularity.)
  56. view-click-event-handler or cell-select also call invert-rect directly on
  57. the "internal double-secret" versions of cell-position and cell-size. 
  58. Thus, if you want custom drawing of a sequence-dialog-item, you're in for a
  59. real interesting time.
  60.  
  61. As much as I like the MCL programming environment, I have to say that
  62. between the simple-view/view and focusing problems, as well as some serious
  63. non-modularity (like this);  the various windowing widgets are due for a
  64. big overhaul.
  65.  
  66. This is not meant as a flame.  The flaws like this have only been found by
  67. pushing MCL to the limit, but they are there.
  68.  
  69. PS:  If, perchance, you *do* roll your own sequence-dialog-item, I would
  70. also recommend that it be a sequence-view (ie subclass of view, not
  71. dialog-item).  I would also like to see it archived if that would be OK.
  72.  
  73. "TANSTAAFL" Rich lynch@ils.nwu.edu
  74.