Created
June 6, 2010 15:14
-
-
Save juergenhoetzel/427650 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns joy.gui.DynaFrame | |
(:gen-class | |
:name joy.gui.DynaFrame | |
:extends javax.swing.JFrame | |
:prefix df- | |
:implements [clojure.lang.IMeta] | |
:state state | |
:init init | |
:constructors {[String] [String]} | |
:methods [[display [java.awt.Container] void] | |
^{:static true} [version [] String]]) | |
(:import (javax.swing JFrame JPanel) (java.awt BorderLayout Container))) | |
(defn df-init [title] | |
[[title] (atom {::title title})]) | |
(defn df-meta [this] @(.state this)) | |
(defn version [] | |
"1.0") | |
(defn df-display [this pane] | |
(doto this | |
(-> .getContentPane .removeAll) | |
(.setContentPane (doto (JPanel.) | |
(.add pane BorderLayout/CENTER))) | |
(.pack) | |
(.setVisible true))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment