                             (setup
                               ([] (binding [*applet* this
                                             *state* state]
-                                    (setup-fn)))))
-
-        bound-meths       (reduce (fn [methods [method-name f]]
-                                    (assoc methods (name method-name)
-                                           (fn [this & args]
-                                             (binding [*applet* this
-                                                       *state* state]
-                                               (apply f args)))))
-                                  {}
-                                  methods)]
-    (update-proxy prx bound-meths)
-    (applet-run prx mode @keep-on-top?)
+                                    (setup-fn))))
+
+                            (draw
+                              [] (binding [*applet* this
+                                           *state* state]
+                                   (draw-fn))))]
+    (applet-run prx renderer @keep-on-top?)
     prx))
 
 (defmacro defapplet

  toupper (memfn toUpperCase))

(defonce untitled-applet-id* (atom 0))

(defn- fix-mname
  "Changes :method-name to :methodName."
  [[mname fun]]
  (let [mname (name mname)
        mr (re-matcher #"\-[a-zA-z]" mname)
        replace-fn (comp #(.replaceFirst mr %) toupper #(.substring % 1))
        fixed-name (if-let [matched (re-find mr)]
                     (replace-fn matched)
                     mname)]
    [(keyword fixed-name) fun]))


(defn applet-stop
  "Stop an applet"

                              (apply applet-set-size size-vec))
                            (when-let [f (:setup options)]
                              (f)))
        frame             (atom nil)
        state             (atom nil)
        keep-on-top?      (atom (:keep-on-top options))
