From 3feee36e8ff61489dce54c126916bf3b54a6b146 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 12 Jan 2014 19:31:35 -0500 Subject: [PATCH] Add stack --- src/play_clj/ui.clj | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/play_clj/ui.clj b/src/play_clj/ui.clj index f860e5c..1243f9d 100644 --- a/src/play_clj/ui.clj +++ b/src/play_clj/ui.clj @@ -6,8 +6,8 @@ [com.badlogic.gdx.scenes.scene2d Actor Stage] [com.badlogic.gdx.scenes.scene2d.ui ButtonGroup CheckBox Dialog HorizontalGroup Image ImageButton ImageTextButton Label ScrollPane - SelectBox Skin Slider Table TextButton TextField Tree Tree$Node - VerticalGroup WidgetGroup Window] + SelectBox Skin Slider Stack Table TextButton TextField Tree + Tree$Node VerticalGroup WidgetGroup Window] [com.badlogic.gdx.scenes.scene2d.utils ActorGestureListener Align ChangeListener ClickListener DragListener FocusListener NinePatchDrawable SpriteDrawable TextureRegionDrawable @@ -300,6 +300,20 @@ [entity k & options] `(u/call! ^Slider (:object ~entity) ~k ~@options)) +(defn stack* + [children] + (create-group (Stack.) children)) + +(defmacro stack + [children & options] + `(let [entity# (stack* ~children)] + (u/calls! ^Stack (:object entity#) ~@options) + entity#)) + +(defmacro stack! + [entity k & options] + `(u/call! ^Stack (:object ~entity) ~k ~@options)) + (defn table* [children] (create-group (Table.) children))