[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
view-cursor
- To: info-mcl@cambridge.apple.com
- Subject: view-cursor
- From: djskrien@COLBY.EDU (Dale J. Skrien)
- Date: Tue, 15 Dec 92 19:11:33 -0500
- Cc: djskrien@host0.COLBY.EDU
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