Re: clojure-clr how to wire up a delegate

2010-02-25 Thread dmiller
Parallel to proxy, clojure-clr adds a gen-delegate. Example code is in http://github.com/richhickey/clojure-clr/blob/master/Clojure/Clojure.Source/clojure/samples/celsius.clj Specifically, for adding an EventHandler: (.add_Click button (gen-delegate EventHandler [sender args] (let [c (Dou

Re: clojure-clr how to wire up a delegate

2010-02-24 Thread adam11235
Excellent that worked. For other clojure-clr newbies, the Clojure.Source project has some samples that are helpful. Thanks, Adam. On Feb 25, 7:39 am, soyrochus wrote: > Hi Adam, > > You need to use the gen-delegate macro to create delegates, > > Seehttp://wiki.github.com/richhickey/clojure-clr/

Re: clojure-clr how to wire up a delegate

2010-02-24 Thread soyrochus
Hi Adam, You need to use the gen-delegate macro to create delegates, See http://wiki.github.com/richhickey/clojure-clr/clr-interop The signature of the macro is (gen-delegate Type [args] body) whereby in case of event-handlers you would typically use the EventHandler class. The code becomes then

Re: clojure-clr how to wire up a delegate

2010-02-24 Thread Joop Kiefte
Forget about the proxy part, re-read your message... =x 2010/2/24 Joop Kiefte : > Tried to encapsulate what you want to put in the eventhandler in an > anonymous function? > > And I don't know how that works in Clojure-CLR, but you might need proxy... > > 2010/2/24 adam11235 : >> Hi, >> >> I've ma

Re: clojure-clr how to wire up a delegate

2010-02-24 Thread Joop Kiefte
Tried to encapsulate what you want to put in the eventhandler in an anonymous function? And I don't know how that works in Clojure-CLR, but you might need proxy... 2010/2/24 adam11235 : > Hi, > > I've made progress in creating a simple app to show a windows form, > however I am having trouble wir

clojure-clr how to wire up a delegate

2010-02-24 Thread adam11235
Hi, I've made progress in creating a simple app to show a windows form, however I am having trouble wiring up a delegate (to handle button clicks). The Java version uses Proxy to implement ActionListener, instead I am just trying to create an EventHandler passing as the 2nd constructor argument t