daveray/seesaw


Seesaw turns the Horror of Swing into a friendly, well-documented, Clojure library

https://groups.google.com/group/seesaw-clj

License: EPL-1.0

Language: Clojure


Build Status

There's now a Google Group for discussion and questions.

Here's a brief tutorial that covers some Seesaw basics. It assumes no knowledge of Swing or Java.

Here's the slides from a Clojure/West 2012 talk on the Seesaw. Best viewed in Chrome or Safari.

Seesaw: Clojure + UI

See the Seesaw Wiki and the Seesaw API Docs for more detailed docs. Note that the docs in the code (use the doc function!) are always the most up-to-date and trustworthy.

Seesaw is a library/DSL for constructing user interfaces in Clojure. It happens to be built on Swing, but please don't hold that against it.

Features

Seesaw is compatible with both Clojure 1.4, but will probably work fine with 1.3 and 1.5. Maybe even 1.2.

  • Swing knowledge is not required for many apps!
  • Construct widgets with simple functions, e.g. (listbox :model (range 100))
  • Support for all of Swing's built-in widgets as well as SwingX.
  • Support for all of Swing's layout managers as well as MigLayout, and JGoodies Forms
  • Convenient shortcuts for most properties. For example, :background :blue or :background "#00f", or :size [640 :by 480].
  • CSS-style selectors with same syntax as Enlive.
  • Unified, extensible event API
  • Unified, extensible selection API
  • Widget binding, i.e. map changes from one widget into one or more others in a more functional style. Also integrates with Clojure's reference types.
  • Graphics
  • i18n
  • An extensive test suite

There are numerous Seesaw examples in test/seesaw/test/examples.

TL;DR

Here's how you use Seesaw with Leiningen

Install lein as described and then:

$ lein new hello-seesaw
$ cd hello-seesaw

Add Seesaw to project.clj

(defproject hello-seesaw "1.0.0-SNAPSHOT"
  :description "FIXME: write"
  :dependencies [[org.clojure/clojure "1.4.0"]
                [seesaw "x.y.z"]])

Replace the Seesaw version with whatever the latest version tag is. See below!

Now edit the generated src/hello_seesaw/core.clj file:

(ns hello-seesaw.core
  (:use seesaw.core))

(defn -main [& args]
  (invoke-later
    (-> (frame :title "Hello",
           :content "Hello, Seesaw",
           :on-close :exit)
     pack!
     show!)))

Now run it:

$ lein run -m hello-seesaw.core

NOTE: Here's how you can run against the bleeding edge of Seesaw:

  • Clone Seesaw from github. Fork if you like. Switch to the "develop" branch.
  • In your Seesaw checkout, run lein install to build it. Note that Seesaw uses Leiningen 2 as of 3 NOV 2012!
  • In your project's project.clj file, change the Seesaw version to X.Y.Z-SNAPSHOT to match whatever's in Seesaw's project.clj.
  • Run lein deps ... actually you can just start coding. lein deps is almost never necessary.
  • Move along

Contributors

  • Meikel Brandmeyer (kotarak)
  • David Brunell (Quantalume)
  • Stuart Campbell (harto)
  • Michael Frericks
  • Jonathan Fischer Friberg (odyssomay)
  • Anthony Grimes (Raynes)
  • Thomas Karolski (MHOOO)
  • Chun-wei Kuo (Domon)
  • Vladimir Matveev (dpx-infinity)
  • Jeff Rose (rosejn)
  • Simon Lundmark (simlun)
  • Jake McCrary (jakemcc)

License

Copyright (C) 2012 Dave Ray

Distributed under the Eclipse Public License, the same as Clojure.

Project Statistics

Sourcerank 11
Repository Size 2.26 MB
Stars 1,217
Forks 137
Watchers 56
Open issues 62
Dependencies 16
Contributors 35
Tags 23
Created
Last updated
Last pushed

Top Contributors See all

Dave Ray Meikel Brandmeyer odyssomay Michael Ummels Mihail Ivanchev Andy Fingerhut Stuart Campbell Marc Liberatore LSH Stathis Sideris Rahul Pilani Ben Smith-Mannschott davesann Paul Jesse Wolfe! Teodor Heggelund Maik Schünemann Chiao Eric Turner CRHough

Packages Referencing this Repo

org.clojars.kingfranz/seesaw
A Swing wrapper/DSL for Clojure. You want seesaw.core, FYI. See http://seesaw-clj.org for more info.
Latest release 2.0.1 - Updated - 1.22K stars
franks42/seesaw
A Swing wrapper/DSL for Clojure. You want seesaw.core, FYI. See http://seesaw-clj.org for more info.
Latest release 1.4.2-SNAPSHOT - Updated - 1.22K stars
seesaw
A Swing wrapper/DSL for Clojure. You want seesaw.core, FYI. See http://seesaw-clj.org for more info.
Latest release 1.5.0 - Updated - 1.22K stars
ghostandthemachine/seesaw
A Swing wrapper/DSL for Clojure. You want seesaw.core, FYI. See http://seesaw-clj.org for more info.
Latest release 1.4.3-SNAPSHOT - Updated - 1.22K stars

Recent Tags See all

1.5.0 May 02, 2018
1.4.5 January 05, 2015
1.4.4 October 11, 2013
1.4.3 March 03, 2013
1.4.2 July 18, 2012
1.4.1 April 29, 2012
1.4.0 March 06, 2012
1.3.0 December 21, 2011
1.2.2 December 05, 2011
1.2.1 October 26, 2011
1.2.0 September 08, 2011
1.1.0 August 04, 2011
1.0.10 July 22, 2011
1.0.9 July 17, 2011
1.0.8 July 17, 2011

Interesting Forks See all

Raynes/seesaw
Primordial Clojure Swing DSL
Clojure - Last pushed - 2 stars

Something wrong with this page? Make a suggestion

Last synced: 2016-11-24 15:54:53 UTC

Login to resync this repository