home *** CD-ROM | disk | FTP | other *** search
- ; book pp.316-317
-
- (require "functions/pressbutton.lsp")
-
- (defmeth spin-proto :rock-plot (&optional (a .15))
- (let* ((angle (send self :angle))
- (k (round (/ a angle))))
- (dotimes (i k) (send self :rotate-2 0 2 angle))
- (dotimes (i (* 2 k)) (send self :rotate-2 0 2 (- angle)))
- (dotimes (i k) (send self :rotate-2 0 2 angle))))
- (defproto spin-rock-control-proto () () button-overlay-proto)
- (send spin-rock-control-proto :title "Rock Plot")
- (defmeth spin-rock-control-proto :do-action (first)
- (send (send self :graph) :rock-plot))
- (defmeth spin-rock-control-proto :resize ()
- (let* ((graph (send self :graph))
- (size (send self :size))
- (width (send graph :canvas-width))
- (height (send graph :canvas-height)))
- (send self :location (- (list width (+ 0 height)) size))))
-