home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!apple!cambridge.apple.com!djskrien@COLBY.EDU
- From: djskrien@COLBY.EDU (Dale J. Skrien)
- Newsgroups: comp.lang.lisp.mcl
- Subject: view-cursor
- Message-ID: <9212160011.AA11803@host0.COLBY.EDU>
- Date: 16 Dec 92 00:11:33 GMT
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 25
- Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
-
-
- I've created a special subclass of view for which I want to continually
- display the mouse position when it is over the view. I want the mouse
- position to be displayed in the view-window of the view but outside
- of the view. So I wrote a method of view-cursor for my view as follows:
-
- (defmethod view-cursor ((self my-special-view-class) where)
- (with-focused-view (view-window self)
- (#_textmode #$patCopy)
- (with-pstrs ((horizontal (format nil "~3d" (point-h where)))
- (vertical (format nil "~3d" (point-v where))))
- (#_moveto 10 10)
- (#_drawstring horizontal)
- (#_moveto 10 40)
- (#_drawstring vertical)))
- *arrow-cursor* ;return the arrow cursor
- )
-
- My Question: Is this the best way to do it (time-wise and
- memory-wise)? In particular, does this do some cons-ing that
- will rapidly eat up memory while the mouse is over the view?
-
- Dale Skrien
- Colby College
- Waterville, ME 04901
-