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
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/
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
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
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
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