home *** CD-ROM | disk | FTP | other *** search
- ; book pp.251-252
-
- (load "book/resize")
-
- (send w :add-slot 'step-size 10)
-
- (defmeth w :step-size (&optional (val nil set))
- (if set (setf (slot-value 'step-size) val))
- (slot-value 'step-size))
-
- (defmeth w :move (x y)
- (send self :x (+ x (send self :x)))
- (send self :y (+ y (send self :y)))
- (send self :redraw))
-
- (defmeth w :do-key (c m1 m2)
- (let ((step (send self :step-size)))
- (case c
- (#\u (send self :move 0 (- step)))
- (#\d (send self :move 0 step))
- (#\r (send self :move step 0))
- (#\l (send self :move (- step) 0)))))
-