Skip to content
daveray edited this page May 17, 2011 · 31 revisions

Native Look and Feel

Call the (native!) function early in your program (like before any other Swing or Seesaw function is called) to get a more "native" behavior. This includes correct menu bar placement in OSX, etc.

A Note on Threading

As noted [here] (http://download.oracle.com/javase/6/docs/api/javax/swing/package-summary.html#threading) Swing is single threaded nearly all UI operations should be executed on the Swing UI dispatch thread. To facilitate this, Seesaw includes the (invoke-now) and (invoke-later) macros. The former executes forms on the UI thread and waits for their completion, while the latter simply schedules the forms for execution sometime in the future.

A typical use for (invoke-later) is to get things going in an app:

(defn -main [& args]
  (invoke-later
    (frame :title "Hello" :content (button :text "Push me"))))
Clone this wiki locally