(defmacro stack [[& bindings] & body]
(let [st (gensym "stack")]
`(let [~st (Box. BoxLayout/PAGE_AXIS)
~@(reduce
(fn [l [f s]]
(concat l
(list f s)
(list '_ `(.add ~st (doto ~f (.setAlignmentX Component/CENTER_ALIGNMENT))))))
'() (partition 2 bindings))]
~@body
~st)))
Comments top
No comments for stack. Log in to add a comment.