Runs thunk in the Swing event thread according to schedule:
- :later => schedule the execution and return immediately
- :now => wait until the execution completes.
(defn do-swing*
"Runs thunk in the Swing event thread according to schedule:
- :later => schedule the execution and return immediately
- :now => wait until the execution completes."
[schedule thunk]
(cond
(= schedule :later) (SwingUtilities/invokeLater thunk)
(= schedule :now) (if (SwingUtilities/isEventDispatchThread)
(thunk)
(SwingUtilities/invokeAndWait thunk)))
nil)
Comments top
No comments for do-swing*. Log in to add a comment.