
Now allow me to show you how it is done.
- First, grab a copy of Griffon 0.1.2 if you haven't done so already.
- Let's create the app, type griffon create-app fractal on your command prompt.
- Go into the app's directory and type griffon install-plugin clojure, this will install the latest version of the Clojure plugin, along with the LangBridge plugin.
- Alright, in order for the view to be able to call the drawing code written in Clojure we need an interface, let's call it FractalPainter. Go into src/interfaces and create a file named fractal/FractalPainter.groovy with the following content
- Good, now for the actual Clojure code. Go into src/clojure and create a file named fractal/ClojureFractalPainter.clj with the following code
The code is pretty much the same as the original, apart from changing the name of the main entry point from draw to paint. - Last piece of the puzzle is the view script itself, here we will call the ClojureFractalPainter.
- Run the application by typing griffon run-app.
Keep on Groovying!