aboutsummaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-07-24 13:37:35 -0500
committerColin Okay <okay@toyful.space>2022-07-24 13:37:35 -0500
commitb510307e505275fffcbd029f4ae437581bc916a9 (patch)
tree711260baab97777057e1c9094f61422f9efa2a70 /gui
parentae2e47be672493d4a83ede984c7c144a03818e23 (diff)
[change] gui/button to work again after removing container class
Diffstat (limited to 'gui')
-rw-r--r--gui/button.lisp23
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