clojurefx/README.md

1.7 KiB

License Clojars Gratipay Flattr this

ClojureFX

[clojurefx "0.3.0"]

A Clojure extension to make working with JavaFX simpler and more idiomatic. It allows you to naturally work with stock JavaFX components through use of extended protocols. Should a feature be missing you can easily extend ClojureFX in your own codebase or just fall back to standard JavaFX methods.

Features

This is in a very early state, so there isn't much yet. Take a look at the ClojureFX manual.

  • Declarative EDN GUI structure compilation
  • FXML loading and scripting
  • NEW Automatic FXML controller generation
  • Simplified event binding (bind a Clojure function to an event trigger)

Declarative UI programming

(def superbutton (compile [Button {:text "Close"
                                   :action #'close-handler}]))

(compile [VBox {:id "TopLevelVBox"
                :children [Label {:text "Hi!"}
                           Label {:text "I'm ClojureFX!"}
                           HBox {:id "HorizontalBox"
                           :children [Button {:text "OK"}
						              superbutton]}]}])