   This string can be passed to native Processing methods."
   [renderer]
   (resolve-constant-key renderer renderer-modes))
-(defn- hide-menu-bar-if-macos []
-  (when (= PApplet/platform PApplet/MACOSX)
-    (.. (Class/forName "japplemenubar.JAppleMenuBar")
-        (getDeclaredMethod "hide" (into-array Class []))
-        (invoke nil (into-array Object [])))))
 
 (defn- display-size
   "Returns size of screen. If there are 2 or more screens it probably return size of

                             (windowIconified [this e])
                             (windowOpened [this e])
                             (windowClosed [this e])))
      (.setUndecorated decor?)
      (.setDefaultCloseOperation close-op)
      (.add applet)
      (.pack))
    (when (= renderer :opengl)
      (.setResizable f false))
    (.show f)
    (.setAlwaysOnTop f keep-on-top?)
    (reset! (:target-obj (meta applet)) f)
    applet))

(defn- applet-run
  "Launches the applet to the specified target."
  [applet title renderer target]
  (case target
    :frame (launch-applet-frame applet title renderer false)
    :perm-frame (launch-applet-frame applet title renderer true)
    :none applet)
  (.init applet))

(def ^{:private true}
  renderer-modes {:p2d    PApplet/P2D

  ; (don't know why, but let's trust Processing guys).
  ; Technically it's not first (there are 'when' and 'let' before 'size'),
  ; but hopefully it will work fine.
  (let [[width height] (:size (meta this))
          renderer (resolve-renderer (:renderer (meta this)))
          file (-> this meta :output-file absolute-path)]
    (when (= (:renderer (meta this)) :pdf)
      (.size this (int width) (int height) renderer file)))
  (with-applet this
    ((:setup-fn (meta this)))))
