0.1.0-SNAPSHOT Arrow_down_16x16
  • (tree & {[[old-path new-path] & code] :action, n :name, :as opts})

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_swing/tree.clj:102 top

(defmacro tree [& {[[old-path new-path] & code] :action n :name :as opts }]
  (let [n (or n (gensym "tree"))]
    `(scroll-panel
      (let [~n (new JTree)]
	(doto ~n
	  ~@(if code
	      [`(add-listener .addTreeSelectionListener TreeSelectionListener
		   (valueChanged [e#]
				 (do-swing
				  (let [~new-path (if-let [p# (.getNewLeadSelectionPath e#)]
						    (path (.getLastPathComponent p#))
						    nil)
					~old-path (if-let [p# (.getOldLeadSelectionPath e#)]
						    (path (.getLastPathComponent p#))
						    nil)]
				    ~@code))))])
	  ~@(auto-setters JTree *tree-known-keys* opts))))))
Vars in clj-swing.tree/tree: defmacro let apply concat doto list seq vector
Used in 0 other vars

Comments top

No comments for tree. Log in to add a comment.