From c03373741557666526202f7dc5150d82073f6f81 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 23 Jun 2022 09:28:13 -0500 Subject: [add] mousemotion handlers; [modify] app subclass interactive --- examples/02-moving-bitmp.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/02-moving-bitmp.lisp') diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp index 4706d1b..5d33de8 100644 --- a/examples/02-moving-bitmp.lisp +++ b/examples/02-moving-bitmp.lisp @@ -29,6 +29,10 @@ (ww::on-mousedown (unit x y clicks button) (format t "~a was clicked at ~a,~a!~%" unit x y))) +(ww::defhandler mouse-over + (ww::on-mousemotion (target x y xrel yrel state) + (print (list target x y xrel yrel state)))) + (defmethod ww::boot ((app bitmap-display)) (let ((bm (make-instance 'ww::bitmap @@ -39,7 +43,8 @@ ;; first (ww::refocus-on bm) (ww::set-handler bm #'move-thing) - (ww::set-handler bm #'thing-clicked ) + (ww::set-handler bm #'thing-clicked) + (ww::set-handler bm #'mouse-over) (ww::add-unit app bm) ;;second (setf (ww::unit-x bm2) 90 -- cgit v1.2.3