Liking cljdoc? Tell your friends :D

seesaw.behave

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.

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.
raw docstring

when-focused-select-allclj

(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:

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:
sourceraw docstring

when-mouse-draggedclj

(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)

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)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close