Simplify slider function

This commit is contained in:
oakes
2014-01-11 22:46:51 -05:00
parent 330f2a347d
commit be6d323cfe

View File

@@ -85,13 +85,14 @@
`(u/create-entity (u/calls! ^Label (label* ~text ~arg) ~@options))) `(u/create-entity (u/calls! ^Label (label* ~text ~arg) ~@options)))
(defn slider* (defn slider*
[min max step is-vert? arg] [{:keys [min max step vertical?]
(Slider. (float min) (float max) (float step) is-vert? arg)) :or {min 0 max 10 step 1 vertical? false}}
arg]
(Slider. (float min) (float max) (float step) vertical? arg))
(defmacro slider (defmacro slider
[min max step is-vert? arg & options] [attrs arg & options]
`(u/create-entity (u/calls! ^Slider (slider* ~min ~max ~step ~is-vert? ~arg) `(u/create-entity (u/calls! ^Slider (slider* ~attrs ~arg) ~@options)))
~@options)))
(defn text-button* (defn text-button*
[^String text arg] [^String text arg]