(ns quil.helpers.applet-listener
  (:gen-class
    :name quil.helpers.AppletListener
    :main false
    :init init
    :state listeners
    :constructors {[java.util.Map] []}
    :methods [["dispose" [] java.lang.Void]]))

(defn safe-call [fn]
  (when fn (fn)))

(defn -init [listeners]
  [[] listeners])

(defn -dispose [this]
  (safe-call (:on-dispose (.listeners this))))
(ns quil.helpers.applet-listener
  (:gen-class
    :name quil.helpers.AppletListener
    :main false
    :init init
    :state listeners
    :constructors {[java.util.Map] []}
    :methods [["dispose" [] java.lang.Object]]))

(defn safe-call [fn]
  (when fn (fn)))

(defn -init [listeners]
  [[] listeners])

(defn -dispose [this]
  (safe-call (:on-dispose (.listeners this))))
Fix on-close handler so it can return any type, not only nil.
Fix on-close handler so it can return any type, not only nil.

quil/quil,jobez/quil-video,mi-mina/quil,craftybones/quil,pxlpnk/quil