Does anyone see what I am doing here. I am creating some SWT code.
....
(import '(org.eclipse.swt.widgets Display Shell Text Widget))
(import '(org.eclipse.swt.widgets Label Menu MenuItem Control))
(import '(org.eclipse.swt.widgets FileDialog MessageBox))
(defn create-menu-bar [sh]
(let [bar (new Menu sh (. SWT BAR))]
(. sh setMenuBar bar)
(doto bar
(. (new MenuItem (. SWT CASCADE)))
(. setText (. resources getString "Window_title")))))
---------------------------------
Here is some similar code that works,
(defn build-menu-bar [sh]
(let [menu-bar (new Menu sh (. SWT BAR))]
(doto (new MenuItem menu-bar (. SWT CASCADE))
(setText "&File"))
menu-bar))
But I keep getting this error.
java.lang.IllegalArgumentException: No matching method found: new for
class org.
eclipse.swt.widgets.Menu (octane_main.clj:0)
at clojure.lang.Compiler.eval(Compiler.java:4153)
at clojure.lang.Compiler.load(Compiler.java:4470)
at clojure.lang.Compiler.loadFile(Compiler.java:4437)
at clojure.lang.Repl.main(Repl.java:66)
Caused by: java.lang.IllegalArgumentException: No matching method
found: new for
class org.eclipse.swt.widgets.Menu
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:
48)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:
28)
at user$create_menu_bar__50.invoke(octane_main.clj:71)
at user$simple_swt__68.invoke(octane_main.clj:99)
at user$main__72.invoke(octane_main.clj:116)
at user$eval__75.invoke(octane_main.clj:118)
at clojure.lang.Compiler.eval(Compiler.java:4142)
... 3 more
Clojure
Here is the constructor of the Super Class of Menu.
public Widget(Widget arg0, int arg1)
Strange.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---