home *** CD-ROM | disk | FTP | other *** search
- ; book pp.274-275
-
- (send graph-proto :add-mouse-mode 'show-coordinates
- :title "Show Coordinates"
- :click :do-show-coordinates
- :cursor 'finger)
-
- #| canvas coordinates
- (defmeth graph-proto :do-show-coordinates (x y n1 n2)
- (let ((s (format nil "~s" (list x y)))
- (mode (send self :draw-mode)))
- (send self :draw-mode 'xor)
- (send self :draw-string s x y)
- (send self :while-button-down #'(lambda (x y) nil))
- (send self :draw-string s x y)
- (send self :draw-mode mode)))
- |#
-
- (defmeth graph-proto :do-show-coordinates (x y m1 m2)
- (let* ((xy (cond (m1 (send self :canvas-to-real x y))
- (m2 (send self :canvas-to-scaled x y))
- (t (list x y))))
- (s (format nil "~s" xy))
- (mode (send self :draw-mode)))
- (send self :draw-mode 'xor)
- (send self :draw-string s x y)
- (send self :while-button-down #'(lambda (x y) nil))
- (send self :draw-string s x y)
- (send self :draw-mode mode)))
-