Permalink
Browse files

Added mouse-position

  • Loading branch information...
odyssomay committed Jun 9, 2011
1 parent f6d9171 commit 9409cd76711498c177649bdae810446f419b3646
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/Hafni/swing/view.clj
View
@@ -63,6 +63,15 @@ Fields:
:icon #(.setIcon l (component %))}]
(init-comp l arrs nil opts)))
+(defn mouse-position
+ "returns the position of the
+mouse as a pair,"
+ []
+ (let [location (.getLocation (java.awt.MouseInfo/getPointerInfo))
+ x (.getX location)
+ y (.getY location)]
+ [x y]))
+
(defn progress-bar
"Create a JProgressBar.
Fields:

0 comments on commit 9409cd7

Please sign in to comment.