Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
add 'dispose-on-close?' per @amalloy again
Browse files Browse the repository at this point in the history
  • Loading branch information
ztellman committed Feb 25, 2015
1 parent f76c6f3 commit 80597ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
.lein-repl-history
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject rhizome "0.2.3"
(defproject rhizome "0.2.4-SNAPSHOT"
:description "a simple way to visualize graphs"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
Expand Down
4 changes: 3 additions & 1 deletion src/rhizome/viz.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

(defn create-frame
"Creates a frame for viewing graphviz images. Only useful if you don't want to use the default frame."
[{:keys [name close-promise]}]
[{:keys [name close-promise dispose-on-close?]}]
(delay
(let [frame (JFrame. ^String name)
image-icon (ImageIcon.)
Expand All @@ -52,6 +52,8 @@
(proxy [WindowAdapter] []
(windowClosing [e]
(.setVisible frame false)
(when dispose-on-close?
(.dispose frame))
(when close-promise
(deliver close-promise true)))))
(.setContentPane pane)
Expand Down

0 comments on commit 80597ee

Please sign in to comment.