diff options
author | Colin Okay <colin@cicadas.surf> | 2022-06-24 07:17:30 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-06-24 07:17:30 -0500 |
commit | ba7828ef2d78f409d5dbdcb74960e083bd6953d4 (patch) | |
tree | c44a0188084a4bcef8a2bfc8a3b6cf19c53f2cbf /examples | |
parent | ef598c382db318de39bea0eb0a5f4c528047b4b8 (diff) |
[example] added focus and blur examples
Diffstat (limited to 'examples')
-rw-r--r-- | examples/02-moving-bitmp.lisp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp index 3a7fbc9..53f9229 100644 --- a/examples/02-moving-bitmp.lisp +++ b/examples/02-moving-bitmp.lisp @@ -62,7 +62,13 @@ (ww::on-mousemotion () (print (list target x y xrel yrel state)))) +(ww::defhandler look-at-me + (ww::on-focus () + (format t "~a got focus~%" target))) +(ww::defhandler look-away + (ww::on-blur () + (format t "~a lost focus~%" target))) (defmethod ww::boot ((app bitmap-display)) (let ((bm @@ -82,6 +88,8 @@ (ww::unit-y bm2) 90) (ww::set-handler bm2 #'move-thing) (ww::set-handler bm2 #'thing-clicked) + (ww::set-handler bm2 #'look-at-me ) + (ww::set-handler bm2 #'look-away) (ww::add-unit app bm2))) |