home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / lisp / mcl / 1335 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  2.4 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: table-dialog-item
  5. Message-ID: <9208281526.AA08762@cambridge.apple.com>
  6. Date: 28 Aug 92 16:33:02 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 35
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Full-Name: Bill St. Clair
  11. Original-To: berger@SOE.Berkeley.Edu (Daniel Berger)
  12. Original-Cc: info-mcl
  13.  
  14. >Here is a pretty silly question -
  15. >
  16. >Is there a programable way to set the contents of a (single) cell of a
  17. >table-dialog-item or a sequence-dialog-item?  I do not want to set the
  18. >contents of the entire sequence (i.e., with set-table-sequence - I'd like
  19. >something like "set-cell-content"), as I do not know what the content is.
  20. >(I may be reading the content in from a file, and would like to create
  21. >the table first and fill the content as I go along).
  22. >
  23. >Am I missing something obvious?
  24.  
  25. A table-dialog-item has no concept of "setting the contents of a cell".
  26. The contents is returned by the CELL-CONTENTS generic function, which
  27. is called by the default DRAW-CELL-CONTENTS method. If you specialize
  28. CELL-CONTENTS, you can compute the value every time rather than storing
  29. it in a data structure. If you specialize DRAW-CELL-CONTENTS, you can
  30. prevent the consing done to convert the CELL-CONTENTS value into a
  31. string.
  32.  
  33. SEQUENCE-DIALOG-ITEM specializes CELL-CONTENTS to return an element
  34. of a sequence. To change the value of a single cell, you change the
  35. value of the corresponding element of the sequence and call REDRAW-CELL.
  36. The function BM-DO-DIALOG-FILE-SEARCH in the file
  37. "ccl:examples;boyer-moore.lisp" illustrates this. It also shows that when
  38. the length of the sequence changes, you need to call SET-TABLE-SEQUENCE.
  39.  
  40. If you make your own class of TABLE-DIALOG-ITEM and specialize
  41. CELL-CONTENTS or DRAW-CELL-CONTENTS, then when the value of a cell changes,
  42. you can simply call REDRAW-CELL on that cell. If the size of your table
  43. changes, you'll need to call SET-TABLE-DIMENSIONS, which will cause a redraw
  44. of the entire table. If you want to prevent this redrawing, it should be
  45. possible, but I haven't tried it yet. Ask me for more help if you really
  46. want to do this, or look at:
  47.  
  48.    "MCL 2.0 CD:Additional MCL Source Code:lib:dialogs.lisp"
  49.