On Wed, Dec 21, 2011 at 1:42 AM, Antonio Recio <amdx6...@gmail.com> wrote: > I would like to convert a java code to clojure that contains the word > "this", but I don't know how to. > > Java: > boxWidget.AddObserver("InteractionEvent", this, "myCallback"); > > Clojure: > (doto boxWidget (.AddObserver "InteractionEvent" this "myCallback"))
(let [listener (proxy ImageObserver ...)] (doto boxWidget (.AddObserver "InteractionEvent" listener "myCallback"))) Look up how to use proxy (or reify) to create ActionListeners, ImageObservers, and other listeners and observers that run some Clojure code body when triggered; create one and pass it as the event listener parameter to such method calls as need them. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en