home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / mcl / 1942 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.8 KB  |  56 lines

  1. Path: sparky!uunet!caen!nic.umass.edu!dime!feng
  2. From: feng@.cs.umass.edu
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: color selected text
  5. Message-ID: <58350@dime.cs.umass.edu>
  6. Date: 6 Jan 93 21:09:49 GMT
  7. Sender: news@dime.cs.umass.edu
  8. Reply-To: feng@.cs.umass.edu ()
  9. Distribution: usa
  10. Organization: University of Massachusetts, Amherst
  11. Lines: 43
  12.  
  13.  
  14. I am implementing an interface. The interface is designed as a dialog
  15. window, in which there are several items, one of them is an editable-
  16. text-dialog-item. I want to color or change the font of the selected 
  17. text in the editable-text-dialog-item. The build-in method set-part-
  18. color does not work for the selection range, but for the whole item.
  19. Has anyone known some method that can make this change ? 
  20.  
  21. For example, the following code makes a dialog window in which an
  22. editable-text-dialog item and a button-dialog-item are enclosed.
  23. The dialog-item-action of the button-dialog-item should color or 
  24. change the font of the selected text in the editable-text-dialog-item 
  25. text-item, once clicking on the button.
  26.  
  27. (setq interface
  28.     (make-instance 'dialog
  29.                    :view-position 'centered
  30.                :view-size #@(250 250)
  31.                :view-subviews
  32.             (list
  33.     (setq text-item
  34.     (make-dialog-item 'editable-text-dialog-item
  35.                       #@(5 20)
  36.               #@(100 180)
  37.               ""
  38.               'nil
  39.               :allow-return t))
  40.     (setq coloring
  41.     (make-dialog-item 'button--dialog-item
  42.                       #@(5 200)
  43.               #@(100 180)
  44.               "coloring selection"
  45.               #'(lambda (item) item))) ;;;I need the
  46.                                                  ;;;coloring method here
  47.     )))
  48.  
  49.  
  50. Any suggestion is very welcomed, even without using the editable item.
  51. However, both the table-dialog-item and sequence-dialog-item can not
  52. be used for this purpose since them can not partially select a cell.
  53. Thank you very much.
  54.  
  55. Fangfang Feng (fff in short)
  56.