On Sun, Mar 4, 2012 at 10:07 AM, Antonio Recio <amdx6...@gmail.com> wrote: > How I can use proxy to set the AddObserver?
I'm not sure what you mean, sorry, but I'll take a guess. If for some reason you want to use proxy rather than fn, it's possible. Also note, there's nothing magic about using IFn here, any interface that provides a method that takes no arguments could potentially work. To me, proxy seems a little less likely to actually work than my first example. I have no idea what vtk is doing under the hood, but in all likelihood they're using reflection, and reflection tends to have some issues with proxy. (def myCallback (proxy [clojure.lang.IFn] [] (invoke [] (let [t (vtkTransform.)] (.GetTransform t) (-> boxWidget .GetProp3D (.SetUserTransform t))))) ; AddObserver is looking for a no-args method, and fns with no args qualify. Their method is named "invoke" from the IFn interface (.AddObserver boxWidget "interactionEvent" myCallback "invoke") -- 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