   "Takes a tree of elements and generates the code to create a new
   element object, set all attributes onto it and add all inside
   elements to it. `make-ui-element` is called recursively on each
-  internal element. Presumes the `*context*` var to be bound."
-  [[el-type attributes & inside-elements]]
+  internal element. Presumes the `*context*` var to be bound. The
+  second argument is a keyword that represents the type of the
+  container UI element will be put in."
+  [[el-type attributes & inside-elements] container-type]
   (let [klass (classname el-type)
         obj (gensym (.getSimpleName klass))]
     `(let [~obj (new ~klass *context*)]
-       ~@(process-attributes el-type obj attributes)
+       ~@(process-attributes el-type obj attributes container-type)
        ~@(map (fn [el]
-                `(.addView ~obj ~(make-ui-element el)))
+                `(.addView ~obj ~(make-ui-element el el-type)))
               inside-elements)
        ~obj)))
 
 (defmacro defui [tree]
-  (make-ui-element tree))
+  (make-ui-element tree nil))
    (throw (Exception. (str "The element with the ID " id
                            " is not present in the elements map")))))

(defmethod transform-attributes :id [el-type obj attributes generated-code]
  [(dissoc attributes :id)
   (if-let [id (:id attributes)]
     (conj generated-code `(register-ui-element ~id ~obj))

        [neko.context :only [*context*]]
        [neko.-utils :only [capitalize]])
  (:require [clojure.string :as string])
  (:import [android.widget Toast LinearLayout Button LinearLayout$LayoutParams]
           [android.view View ViewGroup$LayoutParams]
           android.content.Context))

;; ### Element relations
