diff options
-rw-r--r-- | gui/button.lisp | 23 |
1 files 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 |