From b510307e505275fffcbd029f4ae437581bc916a9 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sun, 24 Jul 2022 13:37:35 -0500 Subject: [change] gui/button to work again after removing container class --- gui/button.lisp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gui/button.lisp b/gui/button.lisp index 7c94663..b4a41e9 100644 --- a/gui/button.lisp +++ b/gui/button.lisp @@ -41,18 +41,23 @@ (add-handler button #'button-released) (with-slots (up down bg) button (when bg - (setf (unit-container bg) button - (unit-visiblep bg) t)) + (setf (unit-visiblep bg) t)) (setf (unit-visiblep down) nil - (unit-visiblep up) t - (unit-container up) button - (unit-container down) button))) + (unit-visiblep up) t))) -(defmethod cleanup ((button button)) +(defmethod add-unit :before ((button button)) (with-slots (up down bg) button - (when bg (cleanup bg)) - (cleanup up) - (cleanup down))) + (when bg + (add-unit bg)) + (add-unit up) + (add-unit down))) + +(defmethod drop-unit :after ((button button)) + (with-slots (up down bg) button + (drop-unit down) + (drop-unit up) + (when bg + (drop-unit bg)))) (defmethod render ((button button)) (with-slots (up down bg) button -- cgit v1.2.3