API for seesaw.event - Seesaw

by Dave Ray

Full namespace name: seesaw.event

Overview

Functions for handling events. Do not use these functions directly.
Use (seesaw.core/listen) instead.

Public Variables and Functions



events-for

function
Usage: (events-for v)
Returns a sequence of event info maps for the given object which can
be either a widget instance or class.

Used by (seesaw.dev/show-events).

See:
  (seesaw.dev/show-events)


listen

function
Usage: (listen targets & more)
*note: use seesaw.core/listen rather than calling this directly*

Install listeners for one or more events on the given target. For example:

  (listen (button "foo")
    :mouse-entered     (fn [e] ...)
    :focus-gained      (fn [e] ...)
    :key-pressed       (fn [e] ...)
    :mouse-wheel-moved (fn [e] ...))

one function can be registered for multiple events by using a set
of event names instead of one:

  (listen (text)
    #{:remove-update :insert-update} (fn [e] ...))

Note in this case that it's smart enough to add a document listener
to the JTextFields document.

Similarly, an event can be registered for all events in a particular swing
listener interface by just using the keyword-ized prefix of the interface
name. For example, to get all callbacks in the MouseListener interface:

  (listen my-widget :mouse (fn [e] ...))

Returns a function which, when called, removes all listeners registered
with this call.

When the target is a JTable and listener type is :selection, only
row selection events are reported. Also note that the source table is
*not* retrievable from the event object.


listen-to-property

function
Usage: (listen-to-property target property event-fn)
List to propertyChange events on a target for a particular named property.
List (listen), returns a function that, when called removes the installed
listener.
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.