add-action-listener

clojure.contrib.swing-utils

  • (add-action-listener component f & args)
Adds an ActionLister to component. When the action fires, f will be
invoked with the event as its first argument followed by args.
Returns the listener.

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 clojure/contrib/swing_utils.clj:23 top

(defn add-action-listener
  "Adds an ActionLister to component. When the action fires, f will be
  invoked with the event as its first argument followed by args.
  Returns the listener."
  [component f & args]
  (let [listener (proxy [ActionListener] []
                   (actionPerformed [event] (apply f event args)))]
    (.addActionListener component listener)
    listener))
Vars in clojure.contrib.swing-utils/add-action-listener: defn let
Used in 0 other vars

Comments top

No comments for add-action-listener. Log in to add a comment.