Clojure - Desktop See-saw


Advertisements

See-saw is a library which can be used for creating desktop applications. In order to use See-saw, first download the .clj file from the following github link https://github.com/daveray/seesaw

Then create a sample desktop application. Following is the code for the same.

(ns web.core
   (:gen-class)
   (:require [seesaw.core :as seesaw]))
(def window (seesaw/frame
   :title "First Example"
   :content "hello world"
   :width 200
   :height 50))
(defn -main
   [& args]
   (seesaw/show! window))

When the above code is run, you will get the following window.

Hello World

The code is pretty self-explanatory.

  • First you need to ensure you use the seesaw.core library so all of the available methods can be used.

  • The attributes of frame and content can be used to define the title and what content needs to be shown in the window.

  • Finally the ‘show!’ function is used to show the window.

clojure_applications.htm
Advertisements