### Running the Example Source: https://github.com/clj-commons/seesaw/blob/master/examples/substance/README.md Instructions to set up project dependencies and run the Substance example using Leiningen. ```shell lein deps lein run ``` -------------------------------- ### Running Seesaw Examples with Leiningen Source: https://github.com/clj-commons/seesaw/blob/master/test/seesaw/test/examples/README.txt Demonstrates how to execute individual Seesaw example applications or launch the GUI browser. Each example app typically includes a `-main` function for direct execution. ```bash lein run -m ``` ```bash lein examples ``` -------------------------------- ### Leiningen Commands for Project Setup Source: https://github.com/clj-commons/seesaw/wiki/Window-Builder Essential Leiningen commands to create a new project, install plugins, generate Eclipse project files, and compile Java sources. ```bash $ lein plugin install lein-eclipse 1.0.0 ``` ```bash $ lein new window-builder ``` ```bash $ cd window-builder ``` ```bash $ lein eclipse ``` ```bash $ lein compile ``` -------------------------------- ### Seesaw Application Entry Point Source: https://github.com/clj-commons/seesaw/blob/master/test/seesaw/test/examples/README.txt Illustrates the common pattern for Seesaw example applications, which utilize a `-main` function as the primary entry point for execution. ```clojure (defn -main [& args] ;; Application logic here (println "Running Seesaw example...")) ``` -------------------------------- ### Running Seesaw Examples and Tests with Leiningen Source: https://github.com/clj-commons/seesaw/wiki/Home Instructions for managing Seesaw projects using Leiningen. This includes commands to run all examples, run individual examples by name, and execute tests, including a watch mode for continuous testing. ```bash $ lein examples $ lein run -m seesaw.test.examples. $ ./lazytest.sh $ ./lazytest-watch.sh ``` -------------------------------- ### Project Setup and Execution Source: https://github.com/clj-commons/seesaw/blob/master/examples/gaidica/README.md Commands for setting up project dependencies and running the application using Leiningen. ```bash $ lein deps ``` ```bash $ lein run -m gaidica.core ``` -------------------------------- ### Seesaw Property Shortcuts Source: https://github.com/clj-commons/seesaw/blob/master/README.md Shows examples of using convenient shortcuts for setting widget properties like background color and size. ```clojure (:background :blue) ``` ```clojure (:background "#00f") ``` ```clojure (:size [640 :by 480]) ``` -------------------------------- ### Seesaw Widget Examples and Log Window (1.3.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Mentions the implementation of a single launcher for Seesaw examples and an experimental auto-scrolling log window in `seesaw.widgets.log-window`, useful for custom widget development. ```clojure ; Run example launcher lein run -m seesaw.test.examples.launcher ; Create a log window (seesaw.widgets.log-window/log-window) ``` -------------------------------- ### Get User Input with Choices using Seesaw's input (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Dialogs The `seesaw.core/input` function supports advanced options, such as providing a list of choices for the user to select from. This example shows how to present a list of cities with associated data and specify how to convert them to strings for display. ```clojure (input "Pick a city" :choices [{ :name "New York" :population 8000000 } { :name "Ann Arbor" :population 100000 } { :name "Twin Peaks" :population 5201 }] :to-string :name) ``` -------------------------------- ### Seesaw Widget Construction Example Source: https://github.com/clj-commons/seesaw/blob/master/README.md Illustrates the basic syntax for constructing UI widgets in Seesaw, such as a listbox populated with numbers. ```clojure (listbox :model (range 100)) ``` -------------------------------- ### Leiningen Project Setup for Seesaw Source: https://github.com/clj-commons/seesaw/blob/master/README.md Demonstrates how to add Seesaw as a dependency to a Leiningen project and configure a basic Clojure application to use Seesaw for UI creation. ```clojure (defproject hello-seesaw "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.4.0"] [seesaw "x.y.z"]]) ``` ```clojure (ns hello-seesaw.core (:use seesaw.core)) (defn -main [& args] (invoke-later (-> (frame :title "Hello", :content "Hello, Seesaw", :on-close :exit) pack! show!))) ``` -------------------------------- ### Discover Widget Options with seesaw.dev Source: https://github.com/clj-commons/seesaw/wiki/Widgets Demonstrates how to use the `show-options` function from `seesaw.dev` to inspect available configuration options for Seesaw widgets. This function provides a detailed breakdown of options, their types, and examples, aiding in widget customization. ```clojure user=> (use 'seesaw.core) nil user=> (use 'seesaw.dev) nil user=> (show-options (label)) javax.swing.JLabel Option Notes/Examples -------------------------- -------------- :background :aliceblue "#f00" "#FF0000" (seesaw.color/color 255 0 0 0 224) :border 5 "Border Title" [5 "Compound" 10] See (seesaw.border/*) :bounds :preferred [x y w h] Use :* to leave component unchanged: [x :* :* h] ... and so on ... ``` -------------------------------- ### Create GridPanel with Border and Columns (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Containers Shows how to create a grid-panel, which arranges components in a grid. This example configures the number of columns and adds a titled border. ```clojure (grid-panel :border "Properties" :columns 2 :items ["Name" (text "Frank") "Address" (text "123 Main St")]) ``` -------------------------------- ### Release Process using Gitflow and Leiningen Source: https://github.com/clj-commons/seesaw/wiki/Release-Procedure This script details the steps for releasing a new version of a project using Gitflow. It covers running tests, starting a release branch, bumping version numbers in project.clj, finishing the release, building and pushing artifacts to clojars, and updating documentation via a gh-pages branch. ```shell # Run tests ./autotest.sh # Start release git flow release start 1.0.2 # Bump version number from 1.0.2-SNAPSHOT to 1.0.2 vim project.clj git commit -a -m "Bumped version for 1.0.2 release" git flow release finish 1.0.2 # Switch to tagged release, build and push to clojars git checkout 1.0.2 rm lib/*.jar lein clean lein push # Back to develop git checkout develop # Bump version from 1.0.2 to 1.0.3-SNAPSHOT vim project.clj git commit -a -m "Begin 1.0.3 dev" # Push everything back to github git push git push --tags # Update docs lein autodoc cd autodoc git add -A git commit -m "Doc update" git push origin gh-pages ``` -------------------------------- ### Create FormPanel with GridBagLayout (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Containers Provides an example of using `form-panel` with GridBagLayout, though MigLayout is recommended for its simplicity and power. This snippet shows the verbose configuration required for GridBagLayout. ```clojure (let [lw 100, tw 200, wh 25] (form-panel :border 10 :items [[(label :text "Name:" :preferred-size [lw :by wh]) :gridy 0 :gridx 0 ] [(text :text (or name "") :preferred-size [tw :by wh]) :gridy 0 :gridx 1 :gridwidth :remainder] [(label :text "category:" :preferred-size [lw :by wh]) :gridy 1 :gridx 0 :gridwidth 1] [(text :text (or category "") :preferred-size [tw :by wh]) :gridy 1 :gridx 1 :gridwidth :remainder] [(label :text "date:" :preferred-size [lw :by wh]) :gridy 2 :gridx 0 :gridwidth 1] [(text :text (or date "") :preferred-size [tw :by wh]) :gridy 2 :gridx 1 :gridwidth :remainder ] [(label :text "comment:" :preferred-size [lw :by wh]) :gridy 3 :gridx 0 :gridwidth 1] [(text :text (or comment "") :preferred-size [tw :by wh]) :gridy 3 :gridx 1 :gridwidth :remainder] ])) ``` -------------------------------- ### Seesaw Drag-and-Drop Support Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Implements basic drag-and-drop (dnd) functionality within the library. Details and examples are available in the `dnd.clj` file. ```clojure ;; Basic drag-and-drop support ;; See: src/seesaw/dnd.clj and src/seesaw/examples/dnd.clj ``` -------------------------------- ### Seesaw SwingX Support Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Introduces basic support for SwingX components within the Seesaw library. While not comprehensive, it covers essential functionalities. An example demonstrating some features is available in the test suite. ```clojure ;; Basic SwingX support in seesaw.swingx ;; Example: https://github.com/daveray/seesaw/blob/develop/test/seesaw/test/examples/swingx.clj ``` -------------------------------- ### Get User Input with Seesaw's input Function (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Dialogs The `seesaw.core/input` function prompts the user for input. The simplest usage takes a string message to display to the user. It can also accept an optional first argument for a parent component. ```clojure (input "Bang the keyboard like a monkey") ``` -------------------------------- ### Register Mouse Events with `listen` Source: https://github.com/clj-commons/seesaw/wiki/Handling-events Demonstrates using the `listen` function to attach multiple event handlers (e.g., `:mouse-clicked`, `:mouse-entered`) to a widget. The `listen` function returns a function that can be called to remove all installed listeners. ```clojure (listen p :mouse-clicked (fn [e] ... do something ...) :mouse-entered (fn [e] ... do something ...) :mouse-exited (fn [e] ... do something ...)) ``` -------------------------------- ### Seesaw Widget Borders: Clojure Examples Source: https://github.com/clj-commons/seesaw/wiki/Borders Demonstrates various ways to apply borders to Seesaw widgets using the `:border` property. This includes creating plain title borders, empty pixel borders, compound borders with title and empty sections, and custom line borders with specified thickness and color. ```clojure :border "Title" (creates a plain title border) :border 10 (creates an empty 10 pixel border) :border [10 "Title" 5] (compound empty/title/empty border) :border (line-border :thickness 3 :color "#FF0000") (red, 3 pixel border) :border (line-border :top 5 :left 5) (5 pixel black border on top and left) ``` -------------------------------- ### Seesaw Color Specification Examples (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Colors Demonstrates the various formats supported by Seesaw for specifying colors, including direct Java Color objects, RGB/RGBA byte arrays, hex color strings, and CSS-named colors. These formats can be used for widget properties like `:foreground` and `:background`. ```clojure :foreground java.awt.Color/BLACK (a raw color object) :foreground (color 255 255 224) (RGB bytes) :foreground (color 255 255 224 128) (RGBA bytes) :foreground "#FFEEDD" (hex color string or keyword) :foreground "#FED" ("short" CSS-style hex color string or keyword) :foreground "aliceblue" (CSS-style named color string or keyword) :foreground (color "#FFEEDD" 128) (hex color string (or name) + alpha) ``` -------------------------------- ### Create Menu Bar with Menus Source: https://github.com/clj-commons/seesaw/wiki/Menus Demonstrates how to construct a standard menu bar for a frame. It includes creating a menubar with multiple menus, each containing actions. The `(native!)` function is mentioned for OSX compatibility. ```clojure (frame :title "MENUS!" :menubar (menubar :items [(menu :text "File" :items [new-action open-action save-action exit-action]) (menu :text "Edit" :items [copy-action paste-action])])) ``` -------------------------------- ### Seesaw Spinner Support Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Adds support for spinner components, commonly used for numeric input. An example demonstrating spinner functionality is provided in the test suite. ```clojure ;; Spinner component support ;; Example: test/seesaw/test/examples/spinner.clj ``` -------------------------------- ### Create and Display a JFrame Source: https://github.com/clj-commons/seesaw/wiki/Home Demonstrates the creation of a basic JFrame with a title and content. The `pack!` function sizes the frame to fit its content, and `show!` makes it visible. The `:content` property accepts arguments that can be converted into widgets. ```clojure (-> (frame :title "Hello" :content "Hi there") pack! show!) ``` -------------------------------- ### Seesaw API Documentation Overview Source: https://github.com/clj-commons/seesaw/blob/master/README.md Provides a high-level overview of the Seesaw API, referencing the official documentation for detailed information on widgets, selectors, events, and more. ```APIDOC Seesaw API Documentation: Refer to the official Seesaw Wiki and API Docs for comprehensive details: - Wiki: https://github.com/clj-commons/seesaw/wiki - API Docs: https://clj-commons.org/seesaw/ Key Areas: - Widgets: Construction and customization of UI elements. - Layouts: Support for Swing, MigLayout, and JGoodies Forms. - Selectors: CSS-style selectors for targeting widgets. - Events: Unified and extensible event handling API. - Selection: Unified and extensible selection API. - Binding: Functional widget binding and integration with Clojure's reference types. - Graphics: Functionality for UI rendering and drawing. - i18n: Resource bundles and internationalization support. Note: The most up-to-date documentation is available via the `doc` function within the Seesaw library itself. ``` -------------------------------- ### Get Widget Selection (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Handling-selection Retrieves the current selection from a widget. Works for single or multi-selection widgets. Returns `nil` if no selection is made. Can also process event objects. ```clojure (if-let [s (selection my-widget)] (println "Current selection is " s) (println "No selection")) ``` ```clojure (doseq [s (selection my-list {:multi? true})] (println "Selected: " s)) ``` ```clojure (listen (select [:#my-list]) :selection (fn [e] (println "Current selection of my-list is: " (selection e)))) ``` -------------------------------- ### Project Configuration for Seesaw and WindowBuilder Source: https://github.com/clj-commons/seesaw/wiki/Window-Builder Set up your Leiningen project by adding the Seesaw dependency and specifying the Java source path. This prepares the project for integrating WindowBuilder-generated Java code. ```clojure (defproject window-builder "0.0.0-SNAPSHOT" :description "Example of using Google Window Builder to create Seesaw forms" :dependencies [ [org.clojure/clojure "1.3.0"] [seesaw "1.4.0"] ] :java-source-path "src") ``` -------------------------------- ### Packing and Showing a Frame Source: https://github.com/clj-commons/seesaw/wiki/Frames Illustrates an idiomatic Clojure pattern for creating, packing, and showing a Seesaw frame. `pack!` adjusts the frame size to fit its content, and `show!` makes the frame visible. This sequence is often used for frames where the content dictates the initial size. ```clojure (-> (frame :title "HI!" ... more options ...) pack! show!) ``` -------------------------------- ### Seesaw Listen and Event Handling Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Documentation on how to use the `listen` function and associated options for event handling, including support for redefining handlers and options during frame construction. ```clojure ;; Modified `(listen)` to accept vars (presumably pointing to functions) as handlers. ;; Support for `:listen` options when constructing a frame. ``` -------------------------------- ### Retrieve Widget Property Values with config Source: https://github.com/clj-commons/seesaw/wiki/Widgets Illustrates how to get the current value of a specific property from a Seesaw widget using the `config` function. This is useful for inspecting the state of widgets after they have been configured or modified. ```clojure (config (select root [:#my-widget]) :enabled?) => false ``` -------------------------------- ### Text Widget Selection (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Handling-selection Manages the selection of text within text widgets. `selection` returns a vector of start and end positions, or `nil` if empty. `selection!` can set the selection range. ```clojure ; To get text selection range: (selection text-widget) ; Returns [start end] or nil ``` ```clojure ; To set text selection range: (selection! text-widget [start end]) ``` -------------------------------- ### Seesaw Development Utilities (show-options, show-events) Source: https://github.com/clj-commons/seesaw/wiki/Home These functions help inspect widget properties and events directly from the REPL, reducing the need to consult external Javadocs. They are invaluable for understanding what options a widget accepts and what events it generates. ```clojure user=> (use 'seesaw.core) nil user=> (use 'seesaw.dev) nil user=> (show-options (label)) ; ... prints a long list of options along with example values ... user=> (show-events (label)) ; ... prints a long list of supported events ... ``` -------------------------------- ### Create Monospaced Text Area Source: https://github.com/clj-commons/seesaw/wiki/Fonts An example showing how to create a multi-line text area with a monospaced font and a specific size using the `:font` property. This is useful for code editing or displaying fixed-width text. ```clojure (text :text "Type some code here" :multi-line? true :font {:name :monospaced :size 15}) ``` -------------------------------- ### Create MigLayout Panel with Constraints (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Containers Demonstrates using `mig-panel` which leverages MigLayout for flexible component arrangement. It shows how to define layout constraints for rows and columns. ```clojure (mig-panel :constraints ["wrap 2" "[shrink 0]20px[200, grow, fill]" "[shrink 0]5px[]"] :items [ ["name:" ] [(text (or name ""))] ["category:" ] [(text (or category ""))] ["date:" ] [(text (or date ""))] ["comment:" ] [(text (or comment ""))]]) ``` -------------------------------- ### Seesaw Core API Enhancements (1.4.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Details core API changes in Seesaw 1.4.0, including the deprecation of `paintable`, the introduction of the `:paint` option for all widgets, full-screen support via `toggle-full-screen!`, undecorated frame creation with `window`, and the `request-focus!` function for managing keyboard focus. ```clojure ; Deprecated: (seesaw.core/paintable) ; New: All widgets support :paint option (seesaw.core/toggle-full-screen! frame) (seesaw.core/window) (seesaw.core/request-focus! widget) ``` -------------------------------- ### Seesaw Label Styling with Colors (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Colors Illustrates how to apply different color specifications to a Seesaw label widget using the `:foreground` and `:background` properties. This example shows setting text color to blue and the background to red. ```clojure (label :text "Hideous" :opaque? true :foreground (color 0 0 255) :background "#FF0000") ``` -------------------------------- ### List Supported Widget Events Source: https://github.com/clj-commons/seesaw/wiki/Handling-events Illustrates how to use the `seesaw.dev/show-events` function in the REPL to discover all events supported by a specific widget, including their grouping and associated listener interfaces. ```clojure user=> (use 'seesaw.core) nil user=> (use 'seesaw.dev) nil user=> (show-events (label)) ``` -------------------------------- ### Creating a Seesaw Frame Source: https://github.com/clj-commons/seesaw/wiki/Frames Demonstrates the basic creation of a top-level window (frame) in Seesaw. The `frame` function accepts various options to configure its appearance and behavior, such as title, close operation, and content. ```clojure (frame :title "An example", :on-close :exit, :content "Some Content") ``` -------------------------------- ### Create FlowPanel with Layout Options (Clojure) Source: https://github.com/clj-commons/seesaw/wiki/Containers Demonstrates creating a flow-panel, which arranges components in a line. It supports alignment and horizontal gap configuration. ```clojure (flow-panel :align :left :hgap 20 :items ["Label" (action :handler (fn [e] (alert "Hello!")) :name "Button") "Another label"]) ``` -------------------------------- ### Seesaw Styling and Look and Feel Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Details on styling text components and integrating with alternative look and feels like Substance/Insubstantial. ```clojure ;; Fixed bug in `:font` property of styled-text. ;; Added an example of using the [Substance/Insubstantial](https://github.com/Insubstantial/insubstantial) look and feel(s) with Seesaw. ``` -------------------------------- ### Seesaw Widget Option Maps Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Widget constructor functions now expose publicly visible partner option maps. This allows for easier inspection and reuse of widget configurations, replacing the previous `with-widget` approach. ```clojure ;; Example: label and label-options (label "My Label") (label-options) ``` -------------------------------- ### Add Popup Menus to Widgets Source: https://github.com/clj-commons/seesaw/wiki/Menus Shows how to attach a popup menu to any widget using the `:popup` property. This property accepts a function that returns a list of actions or menu items, which is invoked when the menu is triggered (e.g., by a right-click). ```clojure (listbox :popup (fn [e] [action1 action2 ...])) ``` -------------------------------- ### Clojure: Apply Widget Properties from Resource Bundle using :resource Prefix Source: https://github.com/clj-commons/seesaw/wiki/Resource-bundles-and-i18n Shows how to apply multiple properties (like text, foreground color, icon) to a widget by specifying a resource bundle prefix. Seesaw and j18n will look up properties prefixed with the given keyword in the resource files. ```clojure (button :resource :my-app.core/my-button) ``` -------------------------------- ### Seesaw Clipboard and RSyntax Integration Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Information on the introduction of clipboard support and integration with RSyntax highlighting editors, including specific modules and text area functionalities. ```clojure ;; Basic clipboard support. See `seesaw.clipboard`. ;; Support for RSyntax highlighting editor. See `seesaw.rsyntax/text-area`. ``` -------------------------------- ### Seesaw Layout and Panel Management Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Notes on layout manipulation capabilities, specifically mentioning the `card-panel` component. ```clojure ;; Layout manipulation for `card-panel` ``` -------------------------------- ### Flow Panel with Mixed Items and Padding Source: https://github.com/clj-commons/seesaw/wiki/Widgets Illustrates constructing a flow panel with labels, a text field, a button, and horizontal padding (`:fill-h`) using `MakeWidget` coercions. ```clojure (let [choose (fn [e] (alert "I should open a file chooser"))] (flow-panel :items ["File" [:fill-h 5] (text (System/getProperty "user.dir")) [:fill-h 5] (action :handler choose :name "...")])) ``` -------------------------------- ### Create and Add Toolbar Actions Source: https://github.com/clj-commons/seesaw/wiki/Actions Demonstrates how to create Seesaw actions with handlers, names, and tooltips, and then add them to a toolbar within a Swing frame. This showcases the typical pattern for integrating interactive elements in a GUI. ```clojure (use 'seesaw.core) (let [open-action (action :handler (fn [e] (alert "I should open a new something.")) :name "Open ..." :key "menu O" :tip "Open a new something something.") exit-action (action :handler (fn [e] (.dispose (to-frame e))) :name "Exit" :tip "Close this window")] (frame :title "Toolbar action test" :content (border-panel :north (toolbar :items [open-action exit-action]) :center "Insert content here"))) ``` -------------------------------- ### Seesaw Graphics and Mouse Utilities (1.4.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Highlights enhancements in Seesaw's graphics and mouse handling. The `:foreground` and `:background` properties in `seesaw.graphics/style` now accept `Paint` objects for gradients, and the `seesaw.mouse` namespace provides helper functions for mouse interactions. ```clojure ; Using gradients with style (seesaw.graphics/style :foreground (linear-gradient ...)) (seesaw.graphics/style :background (radial-gradient ...)) ; Mouse helper functions (example) (seesaw.mouse/mouse-event-x e) ``` -------------------------------- ### Leiningen Plugin Configuration Source: https://github.com/clj-commons/seesaw/wiki/Window-Builder Configure Leiningen to use the lein2-eclipse plugin by adding it to your user profiles. This is necessary for generating Eclipse project files. ```clojure { :user { :java-cmd "C:\\Program Files\\Java\\jdk1.7.0_40\\bin\\java.exe" ;or whatever your path is :plugins [[lein2-eclipse "2.0.0"]] } } ``` -------------------------------- ### Seesaw Selector Syntax - Tag and Class Matching Source: https://github.com/clj-commons/seesaw/wiki/Selectors Explains how Seesaw's selector syntax handles matching widget types by their literal Java class name (e.g., `[:JLabel]`) or by specifying the full Java class name (e.g., `[:]`). ```clojure ; Matches any widget that is a JLabel or a subclass of JLabel (select root [:JLabel]) ; Matches any widget that is exactly javax.swing.JLabel (not subclasses) (select root [:]) ; Matches any widget that is javax.swing.JLabel or a subclass (select root [:]) ``` -------------------------------- ### Seesaw User Data and Binding (1.4.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Explains the addition of the `:user-data` option for associating arbitrary values with widgets, accessible via `user-data`. It also covers extensions to `seesaw.bind/bind` which now returns a callable object, functioning similarly to `listen`. ```clojure ; Associate data with a widget (widget :user-data "my-custom-data") ; Retrieve user data (seesaw.core/user-data widget) ; Extended bindable object (def bound-value (seesaw.bind/bind atom-source widget-property)) ; Call to unregister listeners (bound-value) ``` -------------------------------- ### Seesaw Key Mapping and Value Semantics (1.3.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Details the implementation of key mapping with `seesaw.keymap/map-key` and the introduction of widget value semantics inspired by Clarity. The `seesaw.core.value` and `seesaw.core.value!` functions provide a unified interface for widget values, supporting binding. ```clojure ; Map a key combination (seesaw.keymap/map-key :ctrl "S" (fn [] (save-document))) ; Get widget value (seesaw.core.value widget) ; Set widget value (seesaw.core.value! widget new-value) ``` -------------------------------- ### Register Events via Widget Construction Source: https://github.com/clj-commons/seesaw/wiki/Handling-events Shows how to register event handlers directly during widget creation by using the `:listen` property. This is an alternative to using the `listen` function after the widget has been instantiated. ```clojure (canvas ... :listen [:mouse-clicked (fn [e] ...) ...]) ``` -------------------------------- ### Seesaw Configuration and Binding Extensions (1.3.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Covers improvements to `config` and related functions, allowing them to be invoked on any Swing widget, not just those created by Seesaw. It also notes the addition of `seesaw.bind/filter` and the `:layout` option for getting/setting widget layout managers. ```clojure ; Configure any Swing widget (seesaw.core/config swing-component :text "New Text") ; Filter bindable values (seesaw.bind/filter atom-source (fn [v] (> v 0))) ; Get/Set widget layout (seesaw.core/config widget :layout my-layout-manager) ``` -------------------------------- ### Seesaw Core Macro and Renaming (1.3.0) Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Documents the integration of the `seesaw.core/with-widgets` macro for widget creation and the renaming of `seesaw.invoke/signaller` to `seesaw.invoke/signaller*` with an accompanying helper macro. ```clojure ; Create multiple widgets (seesaw.core/with-widgets [label (label "Hello")] ...) ; Renamed signaller (seesaw.invoke/signaller* event-source event-type handler) ``` -------------------------------- ### Seesaw Config Function Source: https://github.com/clj-commons/seesaw/wiki/Release-Notes Introduces the `(config)` function, which is the dual of `(config!)`. It allows reading options from widgets, such as retrieving the items from a panel. The implementation covers major options. ```clojure ;; Read options from a widget (config my-panel :items) ``` -------------------------------- ### Find Widget by ID using Seesaw Select Source: https://github.com/clj-commons/seesaw/wiki/Selectors Demonstrates how to locate a specific widget within a widget hierarchy using its `:id` attribute with the `seesaw.core/select` function. It shows how to attach an event listener to the found widget. The `select` function requires a root widget and a selector vector. ```clojure (button :id :the-button :text "Push me") ; ... later ... (listen (select root [:#the-button]) :action (fn [e] ; ... do something ... )) ``` -------------------------------- ### Configure Custom SwingX Widgets Source: https://github.com/clj-commons/seesaw/wiki/Widgets Explains how to apply Seesaw's configuration functions, like `config!`, to custom Swing widgets, including those from libraries like SwingX. This allows leveraging Seesaw's declarative style for managing properties of non-Seesaw-created components. ```clojure (let [my-list (org.jdesktop.swingx.JXList.)] (config! my-list :id :my-jxlist ... other listbox options ...)) ```