aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-07-24 13:24:46 -0500
committerColin Okay <okay@toyful.space>2022-07-24 13:24:46 -0500
commitae2e47be672493d4a83ede984c7c144a03818e23 (patch)
tree9e87b12a369d6e1ca9e143c16fb302f11817e9b4 /src
parent758d5dcf7a8ffba2ae607e7cc19cacc54f5ea839 (diff)
[add] cleanup for menu and interactive
Diffstat (limited to 'src')
-rw-r--r--src/interactive/interactive.lisp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interactive/interactive.lisp b/src/interactive/interactive.lisp
index ceacf1b..11bc5ca 100644
--- a/src/interactive/interactive.lisp
+++ b/src/interactive/interactive.lisp
@@ -7,6 +7,14 @@
(focusablep :std t :doc "Whether or not this object can receive application focus."))
(:documentation "Supplies an object with a listener slot."))
+(defun remove-all-handlers (interactive)
+ (loop
+ for type in '(keydown keyup mousedown mouseup mousemotion mousewheel focus blur perframe)
+ do (remove-handler interactive type)))
+
+(defmethod cleanup :after ((ob interactive))
+ (remove-all-handlers ob))
+
(defun add-handler (interactive handler)
"Adds HANDLER to INTERACTIVE. HANDLER is an instance of
WHEELWORK::EVENT-HANDLER, as most readily constructed by using the