GUI FTW! is a declarative GUI library.
Features:
- Supports both Swing and SWT as backends.
- Declare your GUI structure using simple Clojure syntax. No XML!
- Style it in a CSS fashion.
- Put event handlers in stylesheets.
Planned features:
- Bind data from widgets to Clojure’s agents, atoms, vars, etc.
It works. It’s in alpha stage, that means some things will change and it’s a little rough on the edges.
Latest snapshot is available in Downloads section and in Lein/Cake
through Clojars. Just add to :dependecies
:
[guiftw "0.1.0-SNAPSHOT"]
Instead of wiki, I’ve written two analogical examples for Swing and SWT with lots of comments. They’re here and here. I recommend reading Swing example first and then SWT one as the latter contains only Swing-SWT differences.
- Do I have to know Swing or SWT to use GUI FTW?
Yes. GUI FTW is responsible for generating redundant code you would write without it and providing more declarative approach to creating GUIs with Swing or SWT. Still, you have to know the toolkit you are using (classes names, properties, event listeners, etc.).
- Can I run the same code against SWT and Swing?
Not at this point and it’s not planned for the future. GUI FTW is portable across these toolkits because it’s very abstract but your code created using it won’t be (you’ll be using specific classes, properties and event listeners to your toolkit of choice). Probably writing such a bridge could be done but its not in scope of this project (look at the other exciting features implemented and planned on the top of this README! ;) ).
- Could support for framework X be added?
Probably yes. I know Swing and a little of SWT so GUI FTW was created keeping their similarities in mind. BUT: core of the framework is completely independent of one or the other. Technically writing support for another framework is writing one function that is responsible for creating object (like swing-create or swt-create).