Re: EDT interaction

2009-06-13 Thread Kevin Downey
it depends how often you are pushing stuff onto the EDT. I have a similar macro called EDT so I can do stuff like (EDT (.setText foo "bar")) alternatively I would need to type (SwingUtilities/invokeLater #(.setText foo "bar")) or even (SwingUtilities/invokeLater (fn [] (.setText foo "bar"))) On S

Re: EDT interaction

2009-06-13 Thread Aaron Cohen
Isn't this a case of wrapping a Java API needlessly? What's so bad about: (SwingUtilities/invokeLater my-func) ? -- Aaron On Sat, Jun 13, 2009 at 5:59 PM, Kevin Downey wrote: > > On Sat, Jun 13, 2009 at 2:55 PM, Meikel Brandmeyer wrote: >> Hi, >> >> Am 13.06.2009 um 23:29 schrieb Meikel Brandm

Re: EDT interaction

2009-06-13 Thread Kevin Downey
On Sat, Jun 13, 2009 at 2:55 PM, Meikel Brandmeyer wrote: > Hi, > > Am 13.06.2009 um 23:29 schrieb Meikel Brandmeyer: > >> (defmacro get-on-edt >>  [& body] >>  `(get-on-edt* (fn [] ~body))) > > Of course ~...@body instead of ~body... > > Sincerely > Meikel > > I know you (Meikel) already fixed i

Re: EDT interaction

2009-06-13 Thread Meikel Brandmeyer
Hi, Am 13.06.2009 um 23:29 schrieb Meikel Brandmeyer: (defmacro get-on-edt [& body] `(get-on-edt* (fn [] ~body))) Of course ~...@body instead of ~body... Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: EDT interaction

2009-06-13 Thread Kevin Downey
On Sat, Jun 13, 2009 at 2:02 PM, Wrexsoul wrote: > > Now I'm working on some Swing code and came up with these, which are > obviously going to be useful: > > (defmacro do-on-edt [& body] >  `(SwingUtilities/invokeLater #(do ~...@body))) > > (defmacro get-on-edt [& body] >  `(let [ret# (atom nil)]

Re: EDT interaction

2009-06-13 Thread Meikel Brandmeyer
Hi, Am 13.06.2009 um 23:02 schrieb Wrexsoul: Now I'm working on some Swing code and came up with these, which are obviously going to be useful: And which are partly in clojure.contrib.swing-utils :) (defmacro do-on-edt [& body] `(SwingUtilities/invokeLater #(do ~...@body))) (defmacro get-

Re: EDT interaction

2009-06-13 Thread Laurent PETIT
Thank you so much for giving us your light, master of the dotted pair notation ;-) 2009/6/13 Wrexsoul : > > Now I'm working on some Swing code and came up with these, which are > obviously going to be useful: > > (defmacro do-on-edt [& body] >  `(SwingUtilities/invokeLater #(do ~...@body))) > > (