home *** CD-ROM | disk | FTP | other *** search
- ; book pp.276-277
-
- (send graph-proto :add-mouse-mode 'identify
- :title "Identify"
- :click :do-identify
- :cursor 'finger)
-
- (defmeth graph-proto :do-identify (x y m1 m2)
- (let* ((cr (send self :click-range))
- (p (first (send self :points-in-rect
- (- x (round (/ (first cr) 2)))
- (- y (round (/ (second cr) 2)))
- (first cr)
- (second cr)))))
- (if p
- (let ((mode (send self :draw-mode))
- (label (send self :point-label p)))
- (send self :draw-mode 'xor)
- (send self :draw-string label x y)
- (send self :while-button-down #'(lambda (x y) nil))
- (send self :draw-string label x y)
- (send self :draw-mode mode)))))
-