CrossClj

1.5.0 docs

SourceDocs



RECENT

    seesaw

    Clojars

    May 2, 2018


    Readme

    Index of all namespaces


    « Project + dependencies

    A Swing wrapper/DSL for Clojure. You want seesaw.core, FYI. See http://seesaw-clj.org for more info.

    seesaw.actionDocsSource
    Functions for dealing with Swing Actions. Prefer (seesaw.core/action).
    
    seesaw.appletDocsSource
    Macros and functions that make creating an applet with Seesaw a
    little less painful.
    seesaw.behaveDocsSource
    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.
    seesaw.cellsDocsSource
    Functions for implementing custom cell renderers. Note that on
    many core functions (listbox, tree, combobox, etc) a render function
    can be given directly to the :renderer option.
    seesaw.colorDocsSource
    Functions for creating Swing colors. Note that these are implicit
    in the core color options.
    seesaw.configDocsSource
    Functions for configuring widgets. Prefer (seesaw.core/config) and friends.
    
    seesaw.coreDocsSource
    Core functions and macros for Seesaw. Although there are many more
    Seesaw namespaces, usually what you want is in here. Most functions
    in other namespaces have a core wrapper which adds additional
    capability or makes them easier to use.

    VARS

    A abstract-panel abstract-window-options action action-option add! add-styles add-to-tabbed-panel alert alert-impl all-frames assert-ui-thread auto-resize-mode-table

    B base-resource-options boolean-examples border-panel border-panel-options bounds-option-handler box-panel box-panel-options button button-group button-group-options button-options

    C canvas canvas-options card-panel card-panel-options checkbox checkbox-menu-item checkbox-menu-item-options checkbox-options class-property color-examples combobox combobox-options config config! config-drag-enabled-impl config-model-impl ConfigAction ConfigDragEnabled ConfigIcon ConfigModel ConfigText confirm confirm-impl construct convert-text-value custom-dialog custom-dialog-options

    D default-options default-screen-device dialog dialog-defaults dialog-modality-table dialog-option-type-map dialog-result-property dimension-examples dispose! divider-location! divider-location-proportional! drop-mode-to-keyword

    E editor-pane editor-pane-options

    F flow-panel flow-panel-options form-panel form-panel-options frame frame-icon-converter frame-on-close-map frame-options full-screen! full-screen-ensure-undecorated full-screen-window full-screen?

    G get-root get-text grid-bag-panel grid-panel grid-panel-options group-by-id

    H h-alignment-table height hide! horizontal-panel horizontal-panel-options hscroll-table

    I ->InputChoice icon id-for id-of id-property input input-impl insert-toolbar-separators invoke-later invoke-now invoke-soon is-modal-dialog?

    K keyword-to-drop-mode

    L label label-options layout-orientation-option LayoutOrientationConfig left-right-split left-right-split-options list-layout-orientation-table list-selection-mode-table listbox listbox-options listen

    M make-icon make-popup make-widget map->InputChoice map->SelectWith menu menu-item menu-item-options menu-options menubar menubar-options message-type-map model-option Movable move! move-component-by! move-component-to!

    N native!

    O orientation-table

    P pack! paint-component-impl paint-option-handler paint-property paintable password password-options popup popup-option-handler popup-options progress-bar progress-bar-options

    R radio radio-menu-item radio-menu-item-options radio-options remove! repaint! replace! request-focus! restore-full-screen-window-decorations return-from-dialog

    S ->SelectWith scroll! scrollable scrollable-corner-constants scrollable-options select select-with selection selection! selection-mode-option SelectionModeConfig separator separator-options set-scrollable-corner set-text show! show-card! show-modal-dialog Showable slider slider-options spinner spinner-date-by-table spinner-model spinner-options splitter splitter-options style-text! styled-text styled-text-options

    T tab-overflow-table tab-placement-table tabbed-panel tabbed-panel-options table table-columns table-options text text! text-area-options text-field-options text-options timer to-combobox-model to-document to-frame to-list-model to-menu-item to-root to-selectable to-spinner-model to-table-model to-widget toggle toggle-full-screen! toggle-options toolbar toolbar-options top-bottom-split top-bottom-split-options tree tree-options tree-selection-mode-table

    U user-data

    V v-alignment-table value value! vertical-panel vertical-panel-options vscroll-table

    W width window window-options with-password* with-widgets

    X xyz-panel

    seesaw.cursorDocsSource
    Functions for creating Swing cursors.
    
    seesaw.fontDocsSource
    Functions for handling fonts. Note that most core widget functions
    use these implicitly through the :font option.
    seesaw.iconDocsSource
    Functions for loading and creating icons.
    

    VARS

    icon

    seesaw.keymapDocsSource
    Functions for mapping key strokes to actions.
    
    seesaw.metaDocsSource
    Functions for associating metadata with frames and widgets, etc.
    
    seesaw.rsyntaxDocsSource
    Support for RSyntaxTextArea: http://fifesoft.com/rsyntaxtextarea/index.php
    
    seesaw.styleDocsSource
    Functions for styling apps. Prefer (seesaw.core/stylesheet) and friends.
    
    seesaw.valueDocsSource
    Functions for dealing with widget value. Prefer (seesaw.core/value).
    

    VARS

    Value

    seesaw.widget-optionsDocsSource
    Functions and protocol for dealing with widget options.
    
    seesaw.widgets.rounded-labelDocsSource
    Function to create a label with a rounded border and background.
    
    The README below is fetched from the published project artifact. Some relative links may be broken.

    Build Status

    Note that current development is on the develop branch, not master

    There’s now a Google Group for discussion and questions.

    Here’s a brief tutorial that covers some Seesaw basics. It assumes no knowledge of Swing or Java.

    Here’s the slides from a Clojure/West 2012 talk on the Seesaw. Best viewed in Chrome or Safari.

    Seesaw: Clojure + UI

    See the Seesaw Wiki and the Seesaw API Docs for more detailed docs. Note that the docs in the code (use the doc function!) are always the most up-to-date and trustworthy.

    Seesaw is a library/DSL for constructing user interfaces in Clojure. It happens to be built on Swing, but please don’t hold that against it.

    Features

    Seesaw is compatible with both Clojure 1.4, but will probably work fine with 1.3 and 1.5. Maybe even 1.2.

    • Swing knowledge is not required for many apps!
    • Construct widgets with simple functions, e.g. (listbox :model (range 100))
    • Support for all of Swing’s built-in widgets as well as SwingX.
    • Support for all of Swing’s layout managers as well as MigLayout, and JGoodies Forms
    • Convenient shortcuts for most properties. For example, :background :blue or :background "#00f", or :size [640 :by 480].
    • CSS-style selectors with same syntax as Enlive.
    • Unified, extensible event API
    • Unified, extensible selection API
    • Widget binding, i.e. map changes from one widget into one or more others in a more functional style. Also integrates with Clojure’s reference types.
    • Graphics
    • i18n
    • An extensive test suite

    There are numerous Seesaw examples in test/seesaw/test/examples.

    TL;DR

    Here’s how you use Seesaw with Leiningen

    Install lein as described and then:

    $ lein new hello-seesaw
    $ cd hello-seesaw
    

    Add Seesaw to project.clj

    (defproject hello-seesaw "1.0.0-SNAPSHOT"
      :description "FIXME: write"
      :dependencies [[org.clojure/clojure "1.4.0"]
                    [seesaw "x.y.z"]])
    

    Replace the Seesaw version with whatever the latest version tag is. See below!

    Now edit the generated src/hello_seesaw/core.clj file:

    (ns hello-seesaw.core
      (:use seesaw.core))
    
    (defn -main [& args]
      (invoke-later
        (-> (frame :title "Hello",
               :content "Hello, Seesaw",
               :on-close :exit)
         pack!
         show!)))
    

    Now run it:

    $ lein run -m hello-seesaw.core
    

    NOTE: Here’s how you can run against the bleeding edge of Seesaw:

    • Clone Seesaw from github. Fork if you like. Switch to the “develop” branch.
    • In your Seesaw checkout, run lein install to build it. Note that Seesaw uses Leiningen 2 as of 3 NOV 2012!
    • In your project’s project.clj file, change the Seesaw version to X.Y.Z-SNAPSHOT to match whatever’s in Seesaw’s project.clj.
    • Run lein deps … actually you can just start coding. lein deps is almost never necessary.
    • Move along

    Contributors

    • Meikel Brandmeyer (kotarak)
    • David Brunell (Quantalume)
    • Stuart Campbell (harto)
    • Michael Frericks
    • Jonathan Fischer Friberg (odyssomay)
    • Anthony Grimes (Raynes)
    • Thomas Karolski (MHOOO)
    • Chun-wei Kuo (Domon)
    • Vladimir Matveev (dpx-infinity)
    • Jeff Rose (rosejn)
    • Simon Lundmark (simlun)
    • Jake McCrary (jakemcc)

    License

    Copyright (C) 2012 Dave Ray

    Distributed under the Eclipse Public License, the same as Clojure.