From 97a34fe0e8fe37b5b83eadb3be3748cce66d1564 Mon Sep 17 00:00:00 2001 From: oakes Date: Sun, 12 Jan 2014 18:35:29 -0500 Subject: [PATCH] Add window --- src/play_clj/ui.clj | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/play_clj/ui.clj b/src/play_clj/ui.clj index e93defe..57681f1 100644 --- a/src/play_clj/ui.clj +++ b/src/play_clj/ui.clj @@ -7,7 +7,7 @@ [com.badlogic.gdx.scenes.scene2d.ui ButtonGroup CheckBox Dialog HorizontalGroup Image ImageButton ImageTextButton Label ScrollPane SelectBox Skin Slider Table TextButton TextField VerticalGroup - WidgetGroup] + WidgetGroup Window] [com.badlogic.gdx.scenes.scene2d.utils ActorGestureListener Align ChangeListener ClickListener DragListener FocusListener NinePatchDrawable SpriteDrawable TextureRegionDrawable @@ -325,6 +325,20 @@ [entity k & options] `(u/call! ^VerticalGroup (:object ~entity) ~k ~@options)) +(defn window* + [^String title arg children] + (create-group (Window. title arg) children)) + +(defmacro window + [title arg children & options] + `(let [entity# (window* ~title ~arg ~children)] + (u/calls! ^Window (:object entity#) ~@options) + entity#)) + +(defmacro window! + [entity k & options] + `(u/call! ^Window (:object ~entity) ~k ~@options)) + ; listeners (defn ^:private gesture-listener