Is it better style to use the 'proxy'ing to create a class or to use
the gen-class approach.

-------------

(ns net.n01se.MyThread
  (:gen-class
    :extends "java.lang.Thread"
    :constructors {[] [String]}
    :init my-init
    :state myState
    :exposes-methods {getId getIdSuper}))

(defn -my-init []
  (prn :init-my-thread)
  [["my derived class"] "this is my state"])

(defn -getId [this]
  (+ 123000 (.getIdSuper this)))

And I couldn't get this code to work, so I guess I will stick with
proxy
---------------

Here is some action listener code:

(defn create-shell [disp sh]
  ;; Note change in 'doto' call, dot needed.
  (let [layout (new GridLayout)]
    (doto sh
      (. setText (. resources getString "Window_title"))
      (. setAccelerator (str SWT/MOD1 "O"))
      (. setLayout layout)
      (. addShellListener (proxy [ShellAdapter] []
                                 (shellClosed [evt]
                                              (exit)))))))

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

Reply via email to