• Stars
    star
    1,445
  • Rank 31,508 (Top 0.7 %)
  • Language
    Clojure
  • Created about 13 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 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.

More Repositories

1

aleph

Asynchronous streaming communication for Clojure - web server, web client, and raw TCP/UDP
Clojure
2,518
star
2

kibit

There's a function for that!
Clojure
1,752
star
3

manifold

A compatibility layer for event-driven abstractions
Clojure
1,008
star
4

etaoin

Pure Clojure Webdriver protocol implementation
Clojure
893
star
5

marginalia

Ultra-lightweight literate programming for clojure inspired by docco
HTML
810
star
6

secretary

A client-side router for ClojureScript.
Clojure
773
star
7

hickory

HTML as data
Clojure
622
star
8

claypoole

Claypoole: Threadpool tools for Clojure
Clojure
607
star
9

pretty

Library for helping print things prettily, in Clojure - ANSI fonts, formatted exceptions
Clojure
587
star
10

rewrite-clj

Rewrite Clojure code and edn
Clojure
576
star
11

potemkin

some ideas which are almost good
Clojure
564
star
12

pomegranate

A sane Clojure API for Maven Artifact Resolver + dynamic runtime modification of the classpath
Clojure
500
star
13

gloss

speaks in bytes, so you don't have to
Clojure
480
star
14

camel-snake-kebab

A Clojure[Script] library for word case conversions
Clojure
464
star
15

cljss

Clojure Style Sheets โ€” CSS-in-JS for ClojureScript
Clojure
451
star
16

clooj

clooj, a lightweight IDE for clojure
Clojure
416
star
17

byte-streams

A Rosetta stone for JVM byte representations
Clojure
413
star
18

durable-queue

a disk-backed queue for clojure
Clojure
381
star
19

useful

Some Clojure functions we use all the time, and so can you.
Clojure
365
star
20

metrics-clojure

A thin faรงade around Coda Hale's metrics library.
Clojure
341
star
21

citrus

State management library for Rum
Clojure
273
star
22

ordered

Ordered sets and maps, implemented in pure clojure
Clojure
253
star
23

clj-ssh

SSH commands via jsch
Clojure
227
star
24

dirigiste

centrally-planned object and thread pools
Java
204
star
25

primitive-math

for the discerning arithmetician
Clojure
170
star
26

iapetos

A Clojure Prometheus Client
Clojure
169
star
27

humanize

Produce human readable strings in clojure
Clojure
154
star
28

digest

Digest algorithms (md5, sha1 ...) for Clojure
Clojure
151
star
29

clj-yaml

YAML encoding and decoding for Clojure
Clojure
115
star
30

byte-transforms

methods for hashing, compressing, and encoding bytes
Clojure
104
star
31

ring-buffer

A persistent ring-buffer in Clojure
Clojure
96
star
32

tentacles

An Octocat is nothing without his tentacles
Clojure
77
star
33

fs

File system utilities for Clojure. (forked from Raynes/fs)
Clojure
72
star
34

lein-marginalia

A Marginalia plugin to Leiningen
HTML
68
star
35

meta

A meta-repo for clj-commons discussions
46
star
36

ring-gzip-middleware

GZIP your Ring responses
Clojure
41
star
37

rewrite-cljs

Traverse and rewrite Clojure/ClojureScript/EDN from ClojureScript
Clojure
41
star
38

formatter

Building blocks and discussion for building a common Clojure code formatter
36
star
39

vizdeps

Visualize Leiningen dependencies using Graphviz
Clojure
32
star
40

zprint-clj

Node.js wrapper for ZPrint Clojure source code formatter
Clojure
13
star
41

infra

Infrastructure for clj-commons
Clojure
2
star
42

clj-commons.github.io

Clojure Commons Site
HTML
1
star