home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / lisp / mcl / 1844 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.2 KB

  1. Path: sparky!uunet!stanford.edu!apple!cambridge.apple.com!djskrien@COLBY.EDU
  2. From: djskrien@COLBY.EDU (Dale J. Skrien)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: view-cursor
  5. Message-ID: <9212160011.AA11803@host0.COLBY.EDU>
  6. Date: 16 Dec 92 00:11:33 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 25
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11.  
  12. I've created a special subclass of view for which I want to continually
  13. display the mouse position when it is over the view.  I want the mouse
  14. position to be displayed in the view-window of the view but outside
  15. of the view.  So I wrote a method of view-cursor for my view as follows:
  16.  
  17. (defmethod view-cursor ((self my-special-view-class) where)
  18.   (with-focused-view (view-window self)
  19.     (#_textmode #$patCopy)
  20.     (with-pstrs ((horizontal (format nil "~3d" (point-h where)))
  21.                  (vertical (format nil "~3d" (point-v where))))
  22.         (#_moveto 10 10)
  23.     (#_drawstring horizontal)
  24.     (#_moveto 10 40)
  25.     (#_drawstring vertical)))
  26.   *arrow-cursor*   ;return the arrow cursor
  27.   )
  28.  
  29. My Question:  Is this the best way to do it (time-wise and
  30. memory-wise)?  In particular, does this do some cons-ing that
  31. will rapidly eat up memory while the mouse is over the view?
  32.  
  33. Dale Skrien
  34. Colby College
  35. Waterville,  ME  04901
  36.