API for seesaw.behave - Seesaw

by Dave Ray

Full namespace name: seesaw.behave

Overview

A collection of basic behaviors that can be dynamically added to
widgets. Most cover basic functionality that's missing from Swing
or just a pain to implement.

Public Variables and Functions



when-focused-select-all

function
Usage: (when-focused-select-all w)
A helper function which adds a "select all when focus gained" behavior to one
or more text widgets or editable comboboxes.

Like (seesaw.core/listen) returns a function which will remove all event handlers
when called.

Examples:

  (flow-panel :items [
    "Enter some text here: "
    (doto
       (text "All this text will be selected when I get keyboard focus")
       when-focused-select-all)])

See:


when-mouse-dragged

function
Usage: (when-mouse-dragged w & opts)
A helper for handling mouse dragging on a widget. This isn't that complicated,
but the default mouse dragged event provided with Swing doesn't give the delta
since the last drag event so you end up having to keep track of it. This function
takes three options:

  :start event handler called when the drag is started (mouse pressed).
  :drag  A function that takes a mouse event and a [dx dy] vector which is
         the change in x and y since the last drag event.
  :finish event handler called when the drag is finished (mouse released).

Like (seesaw.core/listen) returns a function which will remove all event handlers
when called.

Examples:
  See (seesaw.examples.xyz-panel)
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.